MainCenterManager.cs 667 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class MainCenterManager : MonoBehaviour
  5. {
  6. public static MainCenterManager Instance;
  7. public List<GameObject> list;
  8. private void Awake()
  9. {
  10. Instance = this;
  11. list = new List<GameObject>();
  12. int ct = this.transform.childCount;
  13. for (int i = 0; i < ct; i++)
  14. {
  15. list.Add(this.transform.GetChild(i).gameObject);
  16. }
  17. }
  18. public void show()
  19. {
  20. for (int i = 0; i < list.Count; i++)
  21. {
  22. if(list[i].activeSelf)
  23. list[i].SetActive(false);
  24. }
  25. }
  26. }