LimistMsg.cs 1.6 KB

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