CardItem_Generate.lua 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. ---@class CardItem__Generate_nameTextMVP
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public text UnityEngine.UI.Text
  4. ---@field public uILocalizeScript UILocalizeScript
  5. ---@class CardItem__Generate_nameTextMini
  6. ---@field public gameObject UnityEngine.GameObject
  7. ---@field public text UnityEngine.UI.Text
  8. ---@field public uILocalizeScript UILocalizeScript
  9. ---@class CardItem__Generate_nameTextNormal
  10. ---@field public gameObject UnityEngine.GameObject
  11. ---@field public text UnityEngine.UI.Text
  12. ---@field public uILocalizeScript UILocalizeScript
  13. ---@class CardItem__Generate_lvLocked
  14. ---@field public gameObject UnityEngine.GameObject
  15. ---@field public text UnityEngine.UI.Text
  16. ---@class CardItem__Generate
  17. ---@field private gameObject UnityEngine.GameObject
  18. ---@field private transform UnityEngine.Transform
  19. ---@field private attrBg UnityEngine.GameObject
  20. ---@field private owned UnityEngine.GameObject
  21. ---@field private iconNormal UnityEngine.GameObject
  22. ---@field private iconMini UnityEngine.GameObject
  23. ---@field private iconMVP UnityEngine.GameObject
  24. ---@field private unowned UnityEngine.GameObject
  25. ---@field private locked UnityEngine.GameObject
  26. ---@field private noCard UnityEngine.GameObject
  27. ---@field private notice UnityEngine.GameObject
  28. ---@field private lvLocked CardItem__Generate_lvLocked
  29. ---@field private nameTextNormal CardItem__Generate_nameTextNormal
  30. ---@field private nameTextMini CardItem__Generate_nameTextMini
  31. ---@field private nameTextMVP CardItem__Generate_nameTextMVP
  32. ---@field private grid UnityEngine.GameObject
  33. ---@field private cardAttrItem UnityEngine.GameObject
  34. local CardItemView = class("CardItemView")
  35. function CardItemView:ctor()
  36. end
  37. ---@private
  38. function CardItemView:SetActive(result)
  39. self.gameObject:SetActive(result)
  40. end
  41. ---@private
  42. function CardItemView:InitGenerate(Root, data)
  43. self.transform = Root
  44. self.inited = true
  45. local tmp
  46. self:InitGenerate__1(Root,data)
  47. self:InitGenerate__2(Root,data)
  48. self:InitGenerate__3(Root,data)
  49. self:InitGenerate__4(Root,data)
  50. self:InitGenerate__5(Root,data)
  51. self:InitGenerate__6(Root,data)
  52. self:InitGenerate__7(Root,data)
  53. self:InitGenerate__8(Root,data)
  54. self:InitGenerate__9(Root,data)
  55. self:InitGenerate__10(Root,data)
  56. self:InitGenerate__11(Root,data)
  57. self:InitGenerate__12(Root,data)
  58. self:InitGenerate__13(Root,data)
  59. self:InitGenerate__14(Root,data)
  60. self:InitGenerate__15(Root,data)
  61. self:InitGenerate__16(Root,data)
  62. end
  63. ---@private
  64. function CardItemView:InitGenerate__1(Root, data)
  65. --[[
  66. Root
  67. --]]
  68. end
  69. ---@private
  70. function CardItemView:InitGenerate__2(Root, data)
  71. --[[
  72. AttrBg
  73. --]]
  74. local tmp = Root:Find("AttrBg").gameObject
  75. if tolua.getpeer(tmp) == nil then
  76. tolua.setpeer(tmp, {})
  77. end
  78. self.attrBg = tmp
  79. end
  80. ---@private
  81. function CardItemView:InitGenerate__3(Root, data)
  82. --[[
  83. Info/Icon/Owned
  84. --]]
  85. local tmp = Root:Find("Info/Icon/Owned").gameObject
  86. if tolua.getpeer(tmp) == nil then
  87. tolua.setpeer(tmp, {})
  88. end
  89. self.owned = tmp
  90. end
  91. ---@private
  92. function CardItemView:InitGenerate__4(Root, data)
  93. --[[
  94. Info/Icon/Owned/IconNormal
  95. --]]
  96. local tmp = Root:Find("Info/Icon/Owned/IconNormal").gameObject
  97. if tolua.getpeer(tmp) == nil then
  98. tolua.setpeer(tmp, {})
  99. end
  100. self.iconNormal = tmp
  101. end
  102. ---@private
  103. function CardItemView:InitGenerate__5(Root, data)
  104. --[[
  105. Info/Icon/Owned/IconMini
  106. --]]
  107. local tmp = Root:Find("Info/Icon/Owned/IconMini").gameObject
  108. if tolua.getpeer(tmp) == nil then
  109. tolua.setpeer(tmp, {})
  110. end
  111. self.iconMini = tmp
  112. end
  113. ---@private
  114. function CardItemView:InitGenerate__6(Root, data)
  115. --[[
  116. Info/Icon/Owned/IconMVP
  117. --]]
  118. local tmp = Root:Find("Info/Icon/Owned/IconMVP").gameObject
  119. if tolua.getpeer(tmp) == nil then
  120. tolua.setpeer(tmp, {})
  121. end
  122. self.iconMVP = tmp
  123. end
  124. ---@private
  125. function CardItemView:InitGenerate__7(Root, data)
  126. --[[
  127. Info/Icon/Unowned
  128. --]]
  129. local tmp = Root:Find("Info/Icon/Unowned").gameObject
  130. if tolua.getpeer(tmp) == nil then
  131. tolua.setpeer(tmp, {})
  132. end
  133. self.unowned = tmp
  134. end
  135. ---@private
  136. function CardItemView:InitGenerate__8(Root, data)
  137. --[[
  138. Info/Icon/Locked
  139. --]]
  140. local tmp = Root:Find("Info/Icon/Locked").gameObject
  141. if tolua.getpeer(tmp) == nil then
  142. tolua.setpeer(tmp, {})
  143. end
  144. self.locked = tmp
  145. end
  146. ---@private
  147. function CardItemView:InitGenerate__9(Root, data)
  148. --[[
  149. Info/Name/NoCard
  150. --]]
  151. local tmp = Root:Find("Info/Name/NoCard").gameObject
  152. if tolua.getpeer(tmp) == nil then
  153. tolua.setpeer(tmp, {})
  154. end
  155. self.noCard = tmp
  156. end
  157. ---@private
  158. function CardItemView:InitGenerate__10(Root, data)
  159. --[[
  160. Info/Name/NoCard/notice
  161. --]]
  162. local tmp = Root:Find("Info/Name/NoCard/notice").gameObject
  163. if tolua.getpeer(tmp) == nil then
  164. tolua.setpeer(tmp, {})
  165. end
  166. self.notice = tmp
  167. end
  168. ---@private
  169. function CardItemView:InitGenerate__11(Root, data)
  170. --[[
  171. Info/Name/LvLocked
  172. --]]
  173. local tmp = Root:Find("Info/Name/LvLocked").gameObject
  174. if tolua.getpeer(tmp) == nil then
  175. tolua.setpeer(tmp, {})
  176. end
  177. self.lvLocked = tmp
  178. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  179. end
  180. ---@private
  181. function CardItemView:InitGenerate__12(Root, data)
  182. --[[
  183. Info/Name/NameTextNormal
  184. --]]
  185. local tmp = Root:Find("Info/Name/NameTextNormal").gameObject
  186. if tolua.getpeer(tmp) == nil then
  187. tolua.setpeer(tmp, {})
  188. end
  189. self.nameTextNormal = tmp
  190. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  191. tmp.uILocalizeScript = tmp:GetComponent(Enum.TypeInfo.UILocalizeScript)
  192. end
  193. ---@private
  194. function CardItemView:InitGenerate__13(Root, data)
  195. --[[
  196. Info/Name/NameTextMini
  197. --]]
  198. local tmp = Root:Find("Info/Name/NameTextMini").gameObject
  199. if tolua.getpeer(tmp) == nil then
  200. tolua.setpeer(tmp, {})
  201. end
  202. self.nameTextMini = tmp
  203. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  204. tmp.uILocalizeScript = tmp:GetComponent(Enum.TypeInfo.UILocalizeScript)
  205. end
  206. ---@private
  207. function CardItemView:InitGenerate__14(Root, data)
  208. --[[
  209. Info/Name/NameTextMVP
  210. --]]
  211. local tmp = Root:Find("Info/Name/NameTextMVP").gameObject
  212. if tolua.getpeer(tmp) == nil then
  213. tolua.setpeer(tmp, {})
  214. end
  215. self.nameTextMVP = tmp
  216. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  217. tmp.uILocalizeScript = tmp:GetComponent(Enum.TypeInfo.UILocalizeScript)
  218. end
  219. ---@private
  220. function CardItemView:InitGenerate__15(Root, data)
  221. --[[
  222. Grid
  223. --]]
  224. local tmp = Root:Find("Grid").gameObject
  225. if tolua.getpeer(tmp) == nil then
  226. tolua.setpeer(tmp, {})
  227. end
  228. self.grid = tmp
  229. end
  230. ---@private
  231. function CardItemView:InitGenerate__16(Root, data)
  232. --[[
  233. Grid/CardAttrItem
  234. --]]
  235. local tmp = Root:Find("Grid/CardAttrItem").gameObject
  236. if tolua.getpeer(tmp) == nil then
  237. tolua.setpeer(tmp, {})
  238. end
  239. self.cardAttrItem = CommonUtil.BindGridViewItem2LuaStatic("CardAttrItem", tmp)
  240. self.cardAttrItem.prefabName = "CardAttrItem"
  241. end
  242. ---@private
  243. function CardItemView:GenerateDestroy()
  244. if tolua.getpeer(self.attrBg) ~= nil then
  245. tolua.setpeer(self.attrBg, nil)
  246. end
  247. self.attrBg = nil
  248. if tolua.getpeer(self.owned) ~= nil then
  249. tolua.setpeer(self.owned, nil)
  250. end
  251. self.owned = nil
  252. if tolua.getpeer(self.iconNormal) ~= nil then
  253. tolua.setpeer(self.iconNormal, nil)
  254. end
  255. self.iconNormal = nil
  256. if tolua.getpeer(self.iconMini) ~= nil then
  257. tolua.setpeer(self.iconMini, nil)
  258. end
  259. self.iconMini = nil
  260. if tolua.getpeer(self.iconMVP) ~= nil then
  261. tolua.setpeer(self.iconMVP, nil)
  262. end
  263. self.iconMVP = nil
  264. if tolua.getpeer(self.unowned) ~= nil then
  265. tolua.setpeer(self.unowned, nil)
  266. end
  267. self.unowned = nil
  268. if tolua.getpeer(self.locked) ~= nil then
  269. tolua.setpeer(self.locked, nil)
  270. end
  271. self.locked = nil
  272. if tolua.getpeer(self.noCard) ~= nil then
  273. tolua.setpeer(self.noCard, nil)
  274. end
  275. self.noCard = nil
  276. if tolua.getpeer(self.notice) ~= nil then
  277. tolua.setpeer(self.notice, nil)
  278. end
  279. self.notice = nil
  280. if tolua.getpeer(self.lvLocked) ~= nil then
  281. tolua.setpeer(self.lvLocked, nil)
  282. end
  283. self.lvLocked = nil
  284. if tolua.getpeer(self.nameTextNormal) ~= nil then
  285. tolua.setpeer(self.nameTextNormal, nil)
  286. end
  287. self.nameTextNormal = nil
  288. if tolua.getpeer(self.nameTextMini) ~= nil then
  289. tolua.setpeer(self.nameTextMini, nil)
  290. end
  291. self.nameTextMini = nil
  292. if tolua.getpeer(self.nameTextMVP) ~= nil then
  293. tolua.setpeer(self.nameTextMVP, nil)
  294. end
  295. self.nameTextMVP = nil
  296. if tolua.getpeer(self.grid) ~= nil then
  297. tolua.setpeer(self.grid, nil)
  298. end
  299. self.grid = nil
  300. if self.cardAttrItem.GenerateDestroy ~= nil then
  301. self.cardAttrItem:GenerateDestroy()
  302. end
  303. if tolua.getpeer(self.cardAttrItem) ~= nil then
  304. tolua.setpeer(self.cardAttrItem, nil)
  305. end
  306. self.cardAttrItem = nil
  307. self.transform = nil
  308. self.gameObject = nil
  309. self.inited = false
  310. end
  311. return CardItemView