CardListItem_Generate.lua 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. ---@class CardListItem__Generate_btnReplace
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public button UnityEngine.UI.Button
  4. ---@class CardListItem__Generate_btnPluginCard
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public button UnityEngine.UI.Button
  7. ---@class CardListItem__Generate_attribs
  8. ---@field public gameObject UnityEngine.GameObject
  9. ---@field public gridLayoutGroup UnityEngine.UI.GridLayoutGroup
  10. ---@class CardListItem__Generate_cardName
  11. ---@field public gameObject UnityEngine.GameObject
  12. ---@field public uILocalizeScript UILocalizeScript
  13. ---@class CardListItem__Generate_iconItem
  14. ---@field public gameObject UnityEngine.GameObject
  15. ---@field public rectTransform UnityEngine.RectTransform
  16. ---@field public layoutElement UnityEngine.UI.LayoutElement
  17. ---@class CardListItem__Generate
  18. ---@field private gameObject UnityEngine.GameObject
  19. ---@field private transform UnityEngine.Transform
  20. ---@field private contentItem UnityEngine.GameObject
  21. ---@field private iconItem CardListItem__Generate_iconItem
  22. ---@field private cardName CardListItem__Generate_cardName
  23. ---@field private cardListAttrItem UnityEngine.GameObject
  24. ---@field private attribs CardListItem__Generate_attribs
  25. ---@field private recommend UnityEngine.GameObject
  26. ---@field private btnPluginCard CardListItem__Generate_btnPluginCard
  27. ---@field private btnReplace CardListItem__Generate_btnReplace
  28. local CardListItemView = class("CardListItemView")
  29. function CardListItemView:ctor()
  30. end
  31. ---@private
  32. function CardListItemView:SetActive(result)
  33. self.gameObject:SetActive(result)
  34. end
  35. ---@private
  36. function CardListItemView:InitGenerate(Root, data)
  37. self.transform = Root
  38. self.inited = true
  39. local tmp
  40. self:InitGenerate__1(Root,data)
  41. self:InitGenerate__2(Root,data)
  42. self:InitGenerate__3(Root,data)
  43. self:InitGenerate__4(Root,data)
  44. self:InitGenerate__5(Root,data)
  45. self:InitGenerate__6(Root,data)
  46. self:InitGenerate__7(Root,data)
  47. self:InitGenerate__8(Root,data)
  48. self:InitGenerate__9(Root,data)
  49. end
  50. ---@private
  51. function CardListItemView:InitGenerate__1(Root, data)
  52. --[[
  53. Root
  54. --]]
  55. end
  56. ---@private
  57. function CardListItemView:InitGenerate__2(Root, data)
  58. --[[
  59. ContentItem
  60. --]]
  61. local tmp = Root:Find("ContentItem").gameObject
  62. if tolua.getpeer(tmp) == nil then
  63. tolua.setpeer(tmp, {})
  64. end
  65. self.contentItem = tmp
  66. end
  67. ---@private
  68. function CardListItemView:InitGenerate__3(Root, data)
  69. --[[
  70. ContentItem/IconItem
  71. --]]
  72. local tmp = Root:Find("ContentItem/IconItem").gameObject
  73. if tolua.getpeer(tmp) == nil then
  74. tolua.setpeer(tmp, {})
  75. end
  76. self.iconItem = CommonUtil.BindGridViewItem2LuaStatic("IconItem", tmp)
  77. self.iconItem.prefabName = "IconItem"
  78. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  79. tmp.layoutElement = tmp:GetComponent(Enum.TypeInfo.LayoutElement)
  80. end
  81. ---@private
  82. function CardListItemView:InitGenerate__4(Root, data)
  83. --[[
  84. TextsBox/CardName
  85. --]]
  86. local tmp = Root:Find("TextsBox/CardName").gameObject
  87. if tolua.getpeer(tmp) == nil then
  88. tolua.setpeer(tmp, {})
  89. end
  90. self.cardName = tmp
  91. tmp.uILocalizeScript = tmp:GetComponent(Enum.TypeInfo.UILocalizeScript)
  92. end
  93. ---@private
  94. function CardListItemView:InitGenerate__5(Root, data)
  95. --[[
  96. TextsBox/CardListAttrItem
  97. --]]
  98. local tmp = Root:Find("TextsBox/CardListAttrItem").gameObject
  99. if tolua.getpeer(tmp) == nil then
  100. tolua.setpeer(tmp, {})
  101. end
  102. self.cardListAttrItem = CommonUtil.BindGridViewItem2LuaStatic("CardListAttrItem", tmp)
  103. self.cardListAttrItem.prefabName = "CardListAttrItem"
  104. end
  105. ---@private
  106. function CardListItemView:InitGenerate__6(Root, data)
  107. --[[
  108. TextsBox/Attribs
  109. --]]
  110. local tmp = Root:Find("TextsBox/Attribs").gameObject
  111. if tolua.getpeer(tmp) == nil then
  112. tolua.setpeer(tmp, {})
  113. end
  114. self.attribs = tmp
  115. tmp.gridLayoutGroup = tmp:GetComponent(Enum.TypeInfo.GridLayoutGroup)
  116. end
  117. ---@private
  118. function CardListItemView:InitGenerate__7(Root, data)
  119. --[[
  120. Recommend
  121. --]]
  122. local tmp = Root:Find("Recommend").gameObject
  123. if tolua.getpeer(tmp) == nil then
  124. tolua.setpeer(tmp, {})
  125. end
  126. self.recommend = tmp
  127. end
  128. ---@private
  129. function CardListItemView:InitGenerate__8(Root, data)
  130. --[[
  131. BtnPluginCard
  132. --]]
  133. local tmp = Root:Find("BtnPluginCard").gameObject
  134. if tolua.getpeer(tmp) == nil then
  135. tolua.setpeer(tmp, {})
  136. end
  137. self.btnPluginCard = tmp
  138. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  139. end
  140. ---@private
  141. function CardListItemView:InitGenerate__9(Root, data)
  142. --[[
  143. BtnReplace
  144. --]]
  145. local tmp = Root:Find("BtnReplace").gameObject
  146. if tolua.getpeer(tmp) == nil then
  147. tolua.setpeer(tmp, {})
  148. end
  149. self.btnReplace = tmp
  150. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  151. end
  152. ---@private
  153. function CardListItemView:GenerateDestroy()
  154. if tolua.getpeer(self.contentItem) ~= nil then
  155. tolua.setpeer(self.contentItem, nil)
  156. end
  157. self.contentItem = nil
  158. if self.iconItem.GenerateDestroy ~= nil then
  159. self.iconItem:GenerateDestroy()
  160. end
  161. if tolua.getpeer(self.iconItem) ~= nil then
  162. tolua.setpeer(self.iconItem, nil)
  163. end
  164. self.iconItem = nil
  165. if tolua.getpeer(self.cardName) ~= nil then
  166. tolua.setpeer(self.cardName, nil)
  167. end
  168. self.cardName = nil
  169. if self.cardListAttrItem.GenerateDestroy ~= nil then
  170. self.cardListAttrItem:GenerateDestroy()
  171. end
  172. if tolua.getpeer(self.cardListAttrItem) ~= nil then
  173. tolua.setpeer(self.cardListAttrItem, nil)
  174. end
  175. self.cardListAttrItem = nil
  176. if tolua.getpeer(self.attribs) ~= nil then
  177. tolua.setpeer(self.attribs, nil)
  178. end
  179. self.attribs = nil
  180. if tolua.getpeer(self.recommend) ~= nil then
  181. tolua.setpeer(self.recommend, nil)
  182. end
  183. self.recommend = nil
  184. if tolua.getpeer(self.btnPluginCard) ~= nil then
  185. tolua.setpeer(self.btnPluginCard, nil)
  186. end
  187. self.btnPluginCard = nil
  188. if tolua.getpeer(self.btnReplace) ~= nil then
  189. tolua.setpeer(self.btnReplace, nil)
  190. end
  191. self.btnReplace = nil
  192. self.transform = nil
  193. self.gameObject = nil
  194. self.inited = false
  195. end
  196. return CardListItemView