WidgetItemData.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. using Fort23.Core;
  2. using Fort23.UTool;
  3. using UnityEngine.UI;
  4. using UnityEngine;
  5. using System.Collections.Generic;
  6. using TMPro;
  7. namespace Fort23.Mono
  8. {
  9. public partial class WidgetItem
  10. {
  11. #region 自定义数据
  12. private Button _btnClick;
  13. public Button btnClick
  14. {
  15. get{
  16. if (_btnClick == null)
  17. {
  18. _btnClick = GetUIUnit<Button>("btnClick");
  19. }
  20. return _btnClick;
  21. }
  22. }
  23. private MyImage _bg;
  24. public MyImage bg
  25. {
  26. get{
  27. if (_bg == null)
  28. {
  29. _bg = GetUIUnit<MyImage>("bg");
  30. }
  31. return _bg;
  32. }
  33. }
  34. private MyImage _icon;
  35. public MyImage icon
  36. {
  37. get{
  38. if (_icon == null)
  39. {
  40. _icon = GetUIUnit<MyImage>("icon");
  41. }
  42. return _icon;
  43. }
  44. }
  45. private TextMeshProUGUI _num;
  46. public TextMeshProUGUI num
  47. {
  48. get{
  49. if (_num == null)
  50. {
  51. _num = GetUIUnit<TextMeshProUGUI>("num");
  52. }
  53. return _num;
  54. }
  55. }
  56. private GameObject _numObj;
  57. public GameObject numObj
  58. {
  59. get{
  60. if (_numObj == null)
  61. {
  62. _numObj = GetUIUnit<GameObject>("numObj");
  63. }
  64. return _numObj;
  65. }
  66. }
  67. private MyImage _corner;
  68. public MyImage corner
  69. {
  70. get{
  71. if (_corner == null)
  72. {
  73. _corner = GetUIUnit<MyImage>("corner");
  74. }
  75. return _corner;
  76. }
  77. }
  78. private MyImage _glow;
  79. public MyImage glow
  80. {
  81. get{
  82. if (_glow == null)
  83. {
  84. _glow = GetUIUnit<MyImage>("glow");
  85. }
  86. return _glow;
  87. }
  88. }
  89. private MyImage _light;
  90. public MyImage light
  91. {
  92. get{
  93. if (_light == null)
  94. {
  95. _light = GetUIUnit<MyImage>("light");
  96. }
  97. return _light;
  98. }
  99. }
  100. private MyImage _border;
  101. public MyImage border
  102. {
  103. get{
  104. if (_border == null)
  105. {
  106. _border = GetUIUnit<MyImage>("border");
  107. }
  108. return _border;
  109. }
  110. }
  111. #endregion 自定义数据结束
  112. public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
  113. {
  114. await base.SetUIGameObject(gObjectPoolInterface);
  115. Init();
  116. }
  117. }
  118. }