CardIconItem_Generate.lua 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. ---@class CardIconItem__Generate_btnRemove
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public button UnityEngine.UI.Button
  4. ---@field public repeatButton UnityEngine.UI.RepeatButton
  5. ---@class CardIconItem__Generate_cardName
  6. ---@field public gameObject UnityEngine.GameObject
  7. ---@field public text UnityEngine.UI.Text
  8. ---@class CardIconItem__Generate_lock_text
  9. ---@field public gameObject UnityEngine.GameObject
  10. ---@field public uILocalizeScript UILocalizeScript
  11. ---@class CardIconItem__Generate_lock
  12. ---@field public gameObject UnityEngine.GameObject
  13. ---@field public text CardIconItem__Generate_lock_text
  14. ---@class CardIconItem__Generate_iconItem
  15. ---@field public gameObject UnityEngine.GameObject
  16. ---@field public rectTransform UnityEngine.RectTransform
  17. ---@field public layoutElement UnityEngine.UI.LayoutElement
  18. ---@class CardIconItem__Generate_add
  19. ---@field public gameObject UnityEngine.GameObject
  20. ---@field public button UnityEngine.UI.Button
  21. ---@class CardIconItem__Generate_bg
  22. ---@field public gameObject UnityEngine.GameObject
  23. ---@field public image UnityEngine.UI.Image
  24. ---@field public button UnityEngine.UI.Button
  25. ---@field public repeatButton UnityEngine.UI.RepeatButton
  26. ---@class CardIconItem__Generate
  27. ---@field private gameObject UnityEngine.GameObject
  28. ---@field private transform UnityEngine.Transform
  29. ---@field private bg CardIconItem__Generate_bg
  30. ---@field private add CardIconItem__Generate_add
  31. ---@field private mask UnityEngine.GameObject
  32. ---@field private iconItem CardIconItem__Generate_iconItem
  33. ---@field private selected UnityEngine.GameObject
  34. ---@field private lock CardIconItem__Generate_lock
  35. ---@field private lockLabel UnityEngine.GameObject
  36. ---@field private cardName CardIconItem__Generate_cardName
  37. ---@field private selected2 UnityEngine.GameObject
  38. ---@field private btnRemove CardIconItem__Generate_btnRemove
  39. local CardIconItemView = class("CardIconItemView")
  40. function CardIconItemView:ctor()
  41. end
  42. ---@private
  43. function CardIconItemView:SetActive(result)
  44. self.gameObject:SetActive(result)
  45. end
  46. ---@private
  47. function CardIconItemView:InitGenerate(Root, data)
  48. self.transform = Root
  49. self.inited = true
  50. local tmp
  51. self:InitGenerate__1(Root,data)
  52. self:InitGenerate__2(Root,data)
  53. self:InitGenerate__3(Root,data)
  54. self:InitGenerate__4(Root,data)
  55. self:InitGenerate__5(Root,data)
  56. self:InitGenerate__6(Root,data)
  57. self:InitGenerate__7(Root,data)
  58. self:InitGenerate__8(Root,data)
  59. self:InitGenerate__9(Root,data)
  60. self:InitGenerate__10(Root,data)
  61. self:InitGenerate__11(Root,data)
  62. self:InitGenerate__12(Root,data)
  63. end
  64. ---@private
  65. function CardIconItemView:InitGenerate__1(Root, data)
  66. --[[
  67. Root
  68. --]]
  69. end
  70. ---@private
  71. function CardIconItemView:InitGenerate__2(Root, data)
  72. --[[
  73. Bg
  74. --]]
  75. local tmp = Root:Find("Bg").gameObject
  76. if tolua.getpeer(tmp) == nil then
  77. tolua.setpeer(tmp, {})
  78. end
  79. self.bg = tmp
  80. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  81. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  82. tmp.repeatButton = tmp:GetComponent(Enum.TypeInfo.RepeatButton)
  83. end
  84. ---@private
  85. function CardIconItemView:InitGenerate__3(Root, data)
  86. --[[
  87. Add
  88. --]]
  89. local tmp = Root:Find("Add").gameObject
  90. if tolua.getpeer(tmp) == nil then
  91. tolua.setpeer(tmp, {})
  92. end
  93. self.add = tmp
  94. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  95. end
  96. ---@private
  97. function CardIconItemView:InitGenerate__4(Root, data)
  98. --[[
  99. Mask
  100. --]]
  101. local tmp = Root:Find("Mask").gameObject
  102. if tolua.getpeer(tmp) == nil then
  103. tolua.setpeer(tmp, {})
  104. end
  105. self.mask = tmp
  106. end
  107. ---@private
  108. function CardIconItemView:InitGenerate__5(Root, data)
  109. --[[
  110. IconItem
  111. --]]
  112. local tmp = Root:Find("IconItem").gameObject
  113. if tolua.getpeer(tmp) == nil then
  114. tolua.setpeer(tmp, {})
  115. end
  116. self.iconItem = CommonUtil.BindGridViewItem2LuaStatic("IconItem", tmp)
  117. self.iconItem.prefabName = "IconItem"
  118. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  119. tmp.layoutElement = tmp:GetComponent(Enum.TypeInfo.LayoutElement)
  120. end
  121. ---@private
  122. function CardIconItemView:InitGenerate__6(Root, data)
  123. --[[
  124. Selected
  125. --]]
  126. local tmp = Root:Find("Selected").gameObject
  127. if tolua.getpeer(tmp) == nil then
  128. tolua.setpeer(tmp, {})
  129. end
  130. self.selected = tmp
  131. end
  132. ---@private
  133. function CardIconItemView:InitGenerate__7(Root, data)
  134. --[[
  135. Lock
  136. --]]
  137. local tmp = Root:Find("Lock").gameObject
  138. if tolua.getpeer(tmp) == nil then
  139. tolua.setpeer(tmp, {})
  140. end
  141. self.lock = tmp
  142. end
  143. ---@private
  144. function CardIconItemView:InitGenerate__8(Root, data)
  145. --[[
  146. Lock/LockLabel
  147. --]]
  148. local tmp = Root:Find("Lock/LockLabel").gameObject
  149. if tolua.getpeer(tmp) == nil then
  150. tolua.setpeer(tmp, {})
  151. end
  152. self.lockLabel = tmp
  153. end
  154. ---@private
  155. function CardIconItemView:InitGenerate__9(Root, data)
  156. --[[
  157. Lock/LockLabel/Text
  158. --]]
  159. local tmp = Root:Find("Lock/LockLabel/Text").gameObject
  160. if tolua.getpeer(tmp) == nil then
  161. tolua.setpeer(tmp, {})
  162. end
  163. self.lock.text = tmp
  164. tmp.uILocalizeScript = tmp:GetComponent(Enum.TypeInfo.UILocalizeScript)
  165. end
  166. ---@private
  167. function CardIconItemView:InitGenerate__10(Root, data)
  168. --[[
  169. Name
  170. --]]
  171. local tmp = Root:Find("Name").gameObject
  172. if tolua.getpeer(tmp) == nil then
  173. tolua.setpeer(tmp, {})
  174. end
  175. self.cardName = tmp
  176. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  177. end
  178. ---@private
  179. function CardIconItemView:InitGenerate__11(Root, data)
  180. --[[
  181. Selected2
  182. --]]
  183. local tmp = Root:Find("Selected2").gameObject
  184. if tolua.getpeer(tmp) == nil then
  185. tolua.setpeer(tmp, {})
  186. end
  187. self.selected2 = tmp
  188. end
  189. ---@private
  190. function CardIconItemView:InitGenerate__12(Root, data)
  191. --[[
  192. BtnRemove
  193. --]]
  194. local tmp = Root:Find("BtnRemove").gameObject
  195. if tolua.getpeer(tmp) == nil then
  196. tolua.setpeer(tmp, {})
  197. end
  198. self.btnRemove = tmp
  199. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  200. tmp.repeatButton = tmp:GetComponent(Enum.TypeInfo.RepeatButton)
  201. end
  202. ---@private
  203. function CardIconItemView:GenerateDestroy()
  204. if tolua.getpeer(self.lock.text) ~= nil then
  205. tolua.setpeer(self.lock.text, nil)
  206. end
  207. if tolua.getpeer(self.bg) ~= nil then
  208. tolua.setpeer(self.bg, nil)
  209. end
  210. self.bg = nil
  211. if tolua.getpeer(self.add) ~= nil then
  212. tolua.setpeer(self.add, nil)
  213. end
  214. self.add = nil
  215. if tolua.getpeer(self.mask) ~= nil then
  216. tolua.setpeer(self.mask, nil)
  217. end
  218. self.mask = nil
  219. if self.iconItem.GenerateDestroy ~= nil then
  220. self.iconItem:GenerateDestroy()
  221. end
  222. if tolua.getpeer(self.iconItem) ~= nil then
  223. tolua.setpeer(self.iconItem, nil)
  224. end
  225. self.iconItem = nil
  226. if tolua.getpeer(self.selected) ~= nil then
  227. tolua.setpeer(self.selected, nil)
  228. end
  229. self.selected = nil
  230. if tolua.getpeer(self.lock) ~= nil then
  231. tolua.setpeer(self.lock, nil)
  232. end
  233. self.lock = nil
  234. if tolua.getpeer(self.lockLabel) ~= nil then
  235. tolua.setpeer(self.lockLabel, nil)
  236. end
  237. self.lockLabel = nil
  238. if tolua.getpeer(self.cardName) ~= nil then
  239. tolua.setpeer(self.cardName, nil)
  240. end
  241. self.cardName = nil
  242. if tolua.getpeer(self.selected2) ~= nil then
  243. tolua.setpeer(self.selected2, nil)
  244. end
  245. self.selected2 = nil
  246. if tolua.getpeer(self.btnRemove) ~= nil then
  247. tolua.setpeer(self.btnRemove, nil)
  248. end
  249. self.btnRemove = nil
  250. self.transform = nil
  251. self.gameObject = nil
  252. self.inited = false
  253. end
  254. return CardIconItemView