UIPanel.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Fort23.Mono;
  2. using UnityEngine;
  3. namespace Mono
  4. {
  5. public class UIPanel : UIBasic
  6. {
  7. public override void SetUIRoot(GameObject root)
  8. {
  9. base.Root = root;
  10. UIData = Root.GetComponent<ReferenceCollector>();
  11. GetUIData();
  12. AddButtonEvent();
  13. }
  14. public override void GetUIData()
  15. {
  16. }
  17. public override void AddButtonEvent()
  18. {
  19. }
  20. public override void AddEvent()
  21. {
  22. }
  23. public override void DelEvent()
  24. {
  25. }
  26. public override void Show()
  27. {
  28. Root.gameObject.SetActive(true);
  29. IsShow = true;
  30. AddEvent();
  31. }
  32. public override void Hide()
  33. {
  34. Root.gameObject.SetActive(false);
  35. IsShow = false;
  36. DelEvent();
  37. }
  38. public override void Dispose()
  39. {
  40. Hide();
  41. foreach (var keyValuePair in AllUICom)
  42. {
  43. foreach (var uiCom in keyValuePair.Value)
  44. {
  45. uiCom.Dispose();
  46. }
  47. }
  48. Object.Destroy(Root);
  49. }
  50. }
  51. }