MainLeftCaiDanItem.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class MainLeftCaiDanItem : MonoBehaviour
  7. {
  8. public List<GameObject> hideGame = new List<GameObject>();
  9. public GameObject window;
  10. public GameObject xia;
  11. public GameObject shang;
  12. public static string chooseindex;
  13. private void Start()
  14. {
  15. for (int i = 0; i < hideGame.Count; i++)
  16. {
  17. hideGame[i].SetActive(false);
  18. }
  19. }
  20. public void Choose(bool b)
  21. {
  22. if (b)
  23. {
  24. StartCoroutine(chooseyanchi(b));
  25. this.GetComponent<RawImage>().color = MainLeftManager.Instance.cchoose;
  26. }
  27. else
  28. {
  29. this.GetComponent<RawImage>().color = MainLeftManager.Instance.cnom;
  30. }
  31. }
  32. IEnumerator chooseyanchi(bool b)
  33. {
  34. yield return null;
  35. for (int i = 0; i < hideGame.Count; i++)
  36. {
  37. hideGame[i].SetActive(b);
  38. }
  39. if (xia)
  40. {
  41. xia.SetActive(!b);
  42. shang.SetActive(b);
  43. }
  44. MainCenterManager.Instance.show();
  45. window.SetActive(true);
  46. }
  47. public void shangxia(bool isxia)
  48. {
  49. StartCoroutine(chooseyanchi(isxia));
  50. }
  51. }