MainLeftManager.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class MainLeftManager : MonoBehaviour
  6. {
  7. public static MainLeftManager Instance;
  8. public Color cnom;
  9. public Color cchoose;
  10. // public List<GameObject> list;
  11. private void Awake()
  12. {
  13. Instance = this;
  14. }
  15. IEnumerator Start()
  16. {
  17. yield return new WaitForSeconds(1f);
  18. /*
  19. list = new List<GameObject>();
  20. int ct = this.transform.childCount;
  21. for (int i = 0; i < ct; i++)
  22. {
  23. list.Add(this.transform.GetChild(i).gameObject);
  24. list[i].GetComponent<RawImage>().color = cnom;
  25. }
  26. list[0].GetComponent<RawImage>().color = cchoose;
  27. list[0].GetComponent<MainLeftCaiDanItem>().Choose(true);*/
  28. }
  29. public void choose(string index)
  30. {
  31. }
  32. public List<GameObject> list;
  33. private void OnEnable() {
  34. if(DataManager.admin==1)
  35. {
  36. for (int i = 0;i<list.Count;i++)
  37. {
  38. list[i].SetActive(true);
  39. }
  40. }
  41. else
  42. {
  43. for (int i = 0;i<list.Count;i++)
  44. {
  45. list[i].SetActive(false);
  46. }
  47. }
  48. }
  49. }