UISpoitsPanel.cs 998 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class UISpoitsPanel : UIPanelBase
  6. {
  7. private Transform m_ContentName;
  8. private GameObject m_SpoitPrefab;
  9. private Toggle m_SpoitBtn;
  10. protected override void OnAwake()
  11. {
  12. base.OnAwake();
  13. m_ContentName = CacheTransform.Find("Scroll View (2)/Viewport/UISpoitContent");
  14. m_SpoitPrefab = CacheTransform.Find("Scroll View (2)/Viewport/UISpoitContent/SpoitBtn").gameObject;
  15. m_SpoitBtn = CacheTransform.Find("Scroll View (2)/Viewport/UISpoitContent/SpoitBtn").GetComponent<Toggle>();
  16. }
  17. protected override void OnShow(object param)
  18. {
  19. base.OnShow(param);
  20. }
  21. public override void Hide()
  22. {
  23. base.Hide();
  24. }
  25. public void SetSpoit(string SpoitName, bool state)
  26. {
  27. m_SpoitBtn.transform.Find("Text").GetComponent<Text>().text = SpoitName;
  28. m_SpoitBtn.gameObject.SetActive(state);
  29. }
  30. }