WidgetItemData.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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 GameObject _alertRed;
  68. public GameObject alertRed
  69. {
  70. get{
  71. if (_alertRed == null)
  72. {
  73. _alertRed = GetUIUnit<GameObject>("alertRed");
  74. }
  75. return _alertRed;
  76. }
  77. }
  78. private MyImage _corner;
  79. public MyImage corner
  80. {
  81. get{
  82. if (_corner == null)
  83. {
  84. _corner = GetUIUnit<MyImage>("corner");
  85. }
  86. return _corner;
  87. }
  88. }
  89. private MyImage _glow;
  90. public MyImage glow
  91. {
  92. get{
  93. if (_glow == null)
  94. {
  95. _glow = GetUIUnit<MyImage>("glow");
  96. }
  97. return _glow;
  98. }
  99. }
  100. private MyImage _light;
  101. public MyImage light
  102. {
  103. get{
  104. if (_light == null)
  105. {
  106. _light = GetUIUnit<MyImage>("light");
  107. }
  108. return _light;
  109. }
  110. }
  111. private MyImage _border;
  112. public MyImage border
  113. {
  114. get{
  115. if (_border == null)
  116. {
  117. _border = GetUIUnit<MyImage>("border");
  118. }
  119. return _border;
  120. }
  121. }
  122. private GameObject _lvObj;
  123. public GameObject lvObj
  124. {
  125. get{
  126. if (_lvObj == null)
  127. {
  128. _lvObj = GetUIUnit<GameObject>("lvObj");
  129. }
  130. return _lvObj;
  131. }
  132. }
  133. private Text _txtLv;
  134. public Text txtLv
  135. {
  136. get{
  137. if (_txtLv == null)
  138. {
  139. _txtLv = GetUIUnit<Text>("txtLv");
  140. }
  141. return _txtLv;
  142. }
  143. }
  144. private GameObject _heroShards;
  145. public GameObject heroShards
  146. {
  147. get{
  148. if (_heroShards == null)
  149. {
  150. _heroShards = GetUIUnit<GameObject>("heroShards");
  151. }
  152. return _heroShards;
  153. }
  154. }
  155. private MyImage _heroShardsIcon;
  156. public MyImage heroShardsIcon
  157. {
  158. get{
  159. if (_heroShardsIcon == null)
  160. {
  161. _heroShardsIcon = GetUIUnit<MyImage>("heroShardsIcon");
  162. }
  163. return _heroShardsIcon;
  164. }
  165. }
  166. #endregion 自定义数据结束
  167. public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
  168. {
  169. await base.SetUIGameObject(gObjectPoolInterface);
  170. Init();
  171. }
  172. }
  173. }