DangJianManager.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class DangJianManager : MonoBehaviour
  5. {
  6. public List<GameObject> oldList;
  7. public List<GameObject> newList;
  8. public List<GameObject> sound;
  9. private void Start()
  10. {
  11. for (int i = 0; i < oldList.Count; i++)
  12. {
  13. oldList[i].SetActive(true);
  14. newList[i].SetActive(false);
  15. sound[i].SetActive(false);
  16. }
  17. }
  18. public void show(int index)
  19. {
  20. for (int i = 0; i < oldList.Count; i++)
  21. {
  22. if (index == i)
  23. {
  24. oldList[i].SetActive(false);
  25. newList[i].SetActive(true);
  26. sound[i].SetActive(true);
  27. }
  28. else
  29. {
  30. oldList[i].SetActive(true);
  31. newList[i].SetActive(false);
  32. sound[i].SetActive(false);
  33. }
  34. }
  35. }
  36. public void hide(int index)
  37. {
  38. /*
  39. for (int i = 0; i < oldList.Count; i++)
  40. {
  41. if (index == i)
  42. {
  43. oldList[i].SetActive(true);
  44. newList[i].SetActive(false);
  45. sound[i].SetActive(false);
  46. }
  47. }*/
  48. }
  49. }