WidgetHeroData.cs 2.3 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 WidgetHero
  10. {
  11. #region 自定义数据
  12. private Image _bgImg;
  13. public Image bgImg
  14. {
  15. get{
  16. if (_bgImg == null)
  17. {
  18. _bgImg = GetUIUnit<Image>("bgImg");
  19. }
  20. return _bgImg;
  21. }
  22. }
  23. private MyImage _iconHero;
  24. public MyImage iconHero
  25. {
  26. get{
  27. if (_iconHero == null)
  28. {
  29. _iconHero = GetUIUnit<MyImage>("iconHero");
  30. }
  31. return _iconHero;
  32. }
  33. }
  34. private List<object> _stars;
  35. public List<object> stars
  36. {
  37. get{
  38. if (_stars == null)
  39. {
  40. _stars = GetUIUnit<List<object>>("stars");
  41. }
  42. return _stars;
  43. }
  44. }
  45. private TextMeshProUGUI _lv;
  46. public TextMeshProUGUI lv
  47. {
  48. get{
  49. if (_lv == null)
  50. {
  51. _lv = GetUIUnit<TextMeshProUGUI>("lv");
  52. }
  53. return _lv;
  54. }
  55. }
  56. private MyImage _iconZhiYe;
  57. public MyImage iconZhiYe
  58. {
  59. get{
  60. if (_iconZhiYe == null)
  61. {
  62. _iconZhiYe = GetUIUnit<MyImage>("iconZhiYe");
  63. }
  64. return _iconZhiYe;
  65. }
  66. }
  67. private Button _btnHero;
  68. public Button btnHero
  69. {
  70. get{
  71. if (_btnHero == null)
  72. {
  73. _btnHero = GetUIUnit<Button>("btnHero");
  74. }
  75. return _btnHero;
  76. }
  77. }
  78. private Button _btnUpgrade;
  79. public Button btnUpgrade
  80. {
  81. get{
  82. if (_btnUpgrade == null)
  83. {
  84. _btnUpgrade = GetUIUnit<Button>("btnUpgrade");
  85. }
  86. return _btnUpgrade;
  87. }
  88. }
  89. private Button _btnHeroPanel;
  90. public Button btnHeroPanel
  91. {
  92. get{
  93. if (_btnHeroPanel == null)
  94. {
  95. _btnHeroPanel = GetUIUnit<Button>("btnHeroPanel");
  96. }
  97. return _btnHeroPanel;
  98. }
  99. }
  100. private TextMeshProUGUI _txtUpgrade;
  101. public TextMeshProUGUI txtUpgrade
  102. {
  103. get{
  104. if (_txtUpgrade == null)
  105. {
  106. _txtUpgrade = GetUIUnit<TextMeshProUGUI>("txtUpgrade");
  107. }
  108. return _txtUpgrade;
  109. }
  110. }
  111. #endregion 自定义数据结束
  112. public override async CTask SetUIGameObject(GameObject gObjectPoolInterface)
  113. {
  114. await base.SetUIGameObject(gObjectPoolInterface);
  115. Init();
  116. }
  117. }
  118. }