LimistMsg.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using rtc;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class LimistMsg : MonoBehaviour
  7. {
  8. //未激活
  9. public GameObject[] NoActivitys;
  10. public GameObject[] Activitys;
  11. //已激活
  12. public GameObject[] NoActivitys1;
  13. public GameObject[] Activitys1;
  14. public Text text1;
  15. public Text text2;
  16. public void Init()
  17. {
  18. if (UserInfo.isSN)
  19. {
  20. Heid(NoActivitys);
  21. Show(Activitys);
  22. Show(NoActivitys1);
  23. Heid(Activitys1);
  24. ShowGreen(text1);
  25. ShowWhite(text2);
  26. }
  27. else if (UserInfo.activateType == 1)
  28. {
  29. Heid(NoActivitys);
  30. Show(Activitys);
  31. Show(NoActivitys1);
  32. Heid(Activitys1);
  33. ShowGreen(text1);
  34. ShowWhite(text2);
  35. }
  36. else
  37. {
  38. Show(NoActivitys);
  39. Heid(Activitys);
  40. Heid(NoActivitys1);
  41. Show(Activitys1);
  42. ShowGreen(text2);
  43. ShowWhite(text1);
  44. }
  45. }
  46. public void ShowWhite(Text text)
  47. {
  48. text.color = Color.white;
  49. }
  50. public void ShowGreen(Text text)
  51. {
  52. text.color = Color.green;
  53. }
  54. public void Show(GameObject[] games)
  55. {
  56. for (int i = 0; i < games.Length; i++)
  57. {
  58. games[i].SetActive(true);
  59. }
  60. }
  61. public void Heid(GameObject[] games)
  62. {
  63. for (int i = 0; i < games.Length; i++)
  64. {
  65. games[i].SetActive(false);
  66. }
  67. }
  68. }