ChipItem_Generate.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. ---@class ChipItem__Generate_num
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public text TMPro.TextMeshProUGUI
  4. ---@class ChipItem__Generate_natureIcon
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public image UnityEngine.UI.Image
  7. ---@class ChipItem__Generate_frame
  8. ---@field public gameObject UnityEngine.GameObject
  9. ---@field public image UnityEngine.UI.Image
  10. ---@class ChipItem__Generate_icon
  11. ---@field public gameObject UnityEngine.GameObject
  12. ---@field public image UnityEngine.UI.Image
  13. ---@class ChipItem__Generate_bg
  14. ---@field public gameObject UnityEngine.GameObject
  15. ---@field public image UnityEngine.UI.Image
  16. ---@field public button UnityEngine.UI.Button
  17. ---@class ChipItem__Generate
  18. ---@field private gameObject UnityEngine.GameObject
  19. ---@field private transform UnityEngine.Transform
  20. ---@field private bg ChipItem__Generate_bg
  21. ---@field private icon ChipItem__Generate_icon
  22. ---@field private frame ChipItem__Generate_frame
  23. ---@field private natureIcon ChipItem__Generate_natureIcon
  24. ---@field private redPoint UnityEngine.GameObject
  25. ---@field private num ChipItem__Generate_num
  26. local ChipItemView = class("ChipItemView")
  27. function ChipItemView:ctor()
  28. end
  29. ---@private
  30. function ChipItemView:SetActive(result)
  31. self.gameObject:SetActive(result)
  32. end
  33. ---@private
  34. function ChipItemView:InitGenerate(Root, data)
  35. self.transform = Root
  36. self.inited = true
  37. local tmp
  38. self:InitGenerate__1(Root,data)
  39. self:InitGenerate__2(Root,data)
  40. self:InitGenerate__3(Root,data)
  41. self:InitGenerate__4(Root,data)
  42. self:InitGenerate__5(Root,data)
  43. self:InitGenerate__6(Root,data)
  44. self:InitGenerate__7(Root,data)
  45. end
  46. ---@private
  47. function ChipItemView:InitGenerate__1(Root, data)
  48. --[[
  49. Root
  50. --]]
  51. end
  52. ---@private
  53. function ChipItemView:InitGenerate__2(Root, data)
  54. --[[
  55. Bg
  56. --]]
  57. local tmp = Root:Find("Bg").gameObject
  58. if tolua.getpeer(tmp) == nil then
  59. tolua.setpeer(tmp, {})
  60. end
  61. self.bg = tmp
  62. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  63. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  64. end
  65. ---@private
  66. function ChipItemView:InitGenerate__3(Root, data)
  67. --[[
  68. Icon
  69. --]]
  70. local tmp = Root:Find("Icon").gameObject
  71. if tolua.getpeer(tmp) == nil then
  72. tolua.setpeer(tmp, {})
  73. end
  74. self.icon = tmp
  75. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  76. end
  77. ---@private
  78. function ChipItemView:InitGenerate__4(Root, data)
  79. --[[
  80. Frame
  81. --]]
  82. local tmp = Root:Find("Frame").gameObject
  83. if tolua.getpeer(tmp) == nil then
  84. tolua.setpeer(tmp, {})
  85. end
  86. self.frame = tmp
  87. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  88. end
  89. ---@private
  90. function ChipItemView:InitGenerate__5(Root, data)
  91. --[[
  92. NatureIcon
  93. --]]
  94. local tmp = Root:Find("NatureIcon").gameObject
  95. if tolua.getpeer(tmp) == nil then
  96. tolua.setpeer(tmp, {})
  97. end
  98. self.natureIcon = tmp
  99. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  100. end
  101. ---@private
  102. function ChipItemView:InitGenerate__6(Root, data)
  103. --[[
  104. RedPoint
  105. --]]
  106. local tmp = Root:Find("RedPoint").gameObject
  107. if tolua.getpeer(tmp) == nil then
  108. tolua.setpeer(tmp, {})
  109. end
  110. self.redPoint = tmp
  111. end
  112. ---@private
  113. function ChipItemView:InitGenerate__7(Root, data)
  114. --[[
  115. Num
  116. --]]
  117. local tmp = Root:Find("Num").gameObject
  118. if tolua.getpeer(tmp) == nil then
  119. tolua.setpeer(tmp, {})
  120. end
  121. self.num = tmp
  122. tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
  123. end
  124. ---@private
  125. function ChipItemView:GenerateDestroy()
  126. if tolua.getpeer(self.bg) ~= nil then
  127. tolua.setpeer(self.bg, nil)
  128. end
  129. self.bg = nil
  130. if tolua.getpeer(self.icon) ~= nil then
  131. tolua.setpeer(self.icon, nil)
  132. end
  133. self.icon = nil
  134. if tolua.getpeer(self.frame) ~= nil then
  135. tolua.setpeer(self.frame, nil)
  136. end
  137. self.frame = nil
  138. if tolua.getpeer(self.natureIcon) ~= nil then
  139. tolua.setpeer(self.natureIcon, nil)
  140. end
  141. self.natureIcon = nil
  142. if tolua.getpeer(self.redPoint) ~= nil then
  143. tolua.setpeer(self.redPoint, nil)
  144. end
  145. self.redPoint = nil
  146. if tolua.getpeer(self.num) ~= nil then
  147. tolua.setpeer(self.num, nil)
  148. end
  149. self.num = nil
  150. self.transform = nil
  151. self.gameObject = nil
  152. self.inited = false
  153. end
  154. return ChipItemView