SupportItem_Generate.lua 5.8 KB

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