SlotItem_Generate.lua 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. ---@class SlotItem__Generate_equipFx
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public uIParticle UIExtensions.UIParticle
  4. ---@class SlotItem__Generate_lv
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public text UnityEngine.UI.Text
  7. ---@class SlotItem__Generate_card4
  8. ---@field public gameObject UnityEngine.GameObject
  9. ---@field public image UnityEngine.UI.Image
  10. ---@class SlotItem__Generate_card3
  11. ---@field public gameObject UnityEngine.GameObject
  12. ---@field public image UnityEngine.UI.Image
  13. ---@class SlotItem__Generate_card2
  14. ---@field public gameObject UnityEngine.GameObject
  15. ---@field public image UnityEngine.UI.Image
  16. ---@class SlotItem__Generate_card1
  17. ---@field public gameObject UnityEngine.GameObject
  18. ---@field public image UnityEngine.UI.Image
  19. ---@class SlotItem__Generate_bgPlus
  20. ---@field public gameObject UnityEngine.GameObject
  21. ---@field public image UnityEngine.UI.Image
  22. ---@class SlotItem__Generate_button
  23. ---@field public gameObject UnityEngine.GameObject
  24. ---@field public button UnityEngine.UI.Button
  25. ---@class SlotItem__Generate
  26. ---@field private gameObject UnityEngine.GameObject
  27. ---@field private transform UnityEngine.Transform
  28. ---@field private button SlotItem__Generate_button
  29. ---@field private par UnityEngine.GameObject
  30. ---@field private equipItem UnityEngine.GameObject
  31. ---@field private cardPlus UnityEngine.GameObject
  32. ---@field private bgPlus SlotItem__Generate_bgPlus
  33. ---@field private slot1 UnityEngine.GameObject
  34. ---@field private card1 SlotItem__Generate_card1
  35. ---@field private slot2 UnityEngine.GameObject
  36. ---@field private card2 SlotItem__Generate_card2
  37. ---@field private slot3 UnityEngine.GameObject
  38. ---@field private card3 SlotItem__Generate_card3
  39. ---@field private slot4 UnityEngine.GameObject
  40. ---@field private card4 SlotItem__Generate_card4
  41. ---@field private lv SlotItem__Generate_lv
  42. ---@field private equipFx SlotItem__Generate_equipFx
  43. ---@field private mask UnityEngine.GameObject
  44. ---@field private redPointItem UnityEngine.GameObject
  45. local SlotItemView = class("SlotItemView")
  46. function SlotItemView:ctor()
  47. end
  48. ---@private
  49. function SlotItemView:SetActive(result)
  50. self.gameObject:SetActive(result)
  51. end
  52. ---@private
  53. function SlotItemView:InitGenerate(Root, data)
  54. self.transform = Root
  55. self.inited = true
  56. local tmp
  57. self:InitGenerate__1(Root,data)
  58. self:InitGenerate__2(Root,data)
  59. self:InitGenerate__3(Root,data)
  60. self:InitGenerate__4(Root,data)
  61. self:InitGenerate__5(Root,data)
  62. self:InitGenerate__6(Root,data)
  63. self:InitGenerate__7(Root,data)
  64. self:InitGenerate__8(Root,data)
  65. self:InitGenerate__9(Root,data)
  66. self:InitGenerate__10(Root,data)
  67. self:InitGenerate__11(Root,data)
  68. self:InitGenerate__12(Root,data)
  69. self:InitGenerate__13(Root,data)
  70. self:InitGenerate__14(Root,data)
  71. self:InitGenerate__15(Root,data)
  72. self:InitGenerate__16(Root,data)
  73. self:InitGenerate__17(Root,data)
  74. self:InitGenerate__18(Root,data)
  75. end
  76. ---@private
  77. function SlotItemView:InitGenerate__1(Root, data)
  78. --[[
  79. Root
  80. --]]
  81. end
  82. ---@private
  83. function SlotItemView:InitGenerate__2(Root, data)
  84. --[[
  85. Button
  86. --]]
  87. local tmp = Root:Find("Button").gameObject
  88. if tolua.getpeer(tmp) == nil then
  89. tolua.setpeer(tmp, {})
  90. end
  91. self.button = tmp
  92. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  93. end
  94. ---@private
  95. function SlotItemView:InitGenerate__3(Root, data)
  96. --[[
  97. FX_UI_zhuangbei_dianji
  98. --]]
  99. local tmp = Root:Find("FX_UI_zhuangbei_dianji").gameObject
  100. if tolua.getpeer(tmp) == nil then
  101. tolua.setpeer(tmp, {})
  102. end
  103. self.par = tmp
  104. end
  105. ---@private
  106. function SlotItemView:InitGenerate__4(Root, data)
  107. --[[
  108. EquipItem
  109. --]]
  110. local tmp = Root:Find("EquipItem").gameObject
  111. if tolua.getpeer(tmp) == nil then
  112. tolua.setpeer(tmp, {})
  113. end
  114. self.equipItem = CommonUtil.BindGridViewItem2LuaStatic("EquipItem", tmp)
  115. self.equipItem.prefabName = "EquipItem"
  116. end
  117. ---@private
  118. function SlotItemView:InitGenerate__5(Root, data)
  119. --[[
  120. CardPlus
  121. --]]
  122. local tmp = Root:Find("CardPlus").gameObject
  123. if tolua.getpeer(tmp) == nil then
  124. tolua.setpeer(tmp, {})
  125. end
  126. self.cardPlus = tmp
  127. end
  128. ---@private
  129. function SlotItemView:InitGenerate__6(Root, data)
  130. --[[
  131. CardPlus/BgPlus
  132. --]]
  133. local tmp = Root:Find("CardPlus/BgPlus").gameObject
  134. if tolua.getpeer(tmp) == nil then
  135. tolua.setpeer(tmp, {})
  136. end
  137. self.bgPlus = tmp
  138. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  139. end
  140. ---@private
  141. function SlotItemView:InitGenerate__7(Root, data)
  142. --[[
  143. CardPlus/CardsGrid/Slot1
  144. --]]
  145. local tmp = Root:Find("CardPlus/CardsGrid/Slot1").gameObject
  146. if tolua.getpeer(tmp) == nil then
  147. tolua.setpeer(tmp, {})
  148. end
  149. self.slot1 = tmp
  150. end
  151. ---@private
  152. function SlotItemView:InitGenerate__8(Root, data)
  153. --[[
  154. CardPlus/CardsGrid/Slot1/Card1
  155. --]]
  156. local tmp = Root:Find("CardPlus/CardsGrid/Slot1/Card1").gameObject
  157. if tolua.getpeer(tmp) == nil then
  158. tolua.setpeer(tmp, {})
  159. end
  160. self.card1 = tmp
  161. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  162. end
  163. ---@private
  164. function SlotItemView:InitGenerate__9(Root, data)
  165. --[[
  166. CardPlus/CardsGrid/Slot2
  167. --]]
  168. local tmp = Root:Find("CardPlus/CardsGrid/Slot2").gameObject
  169. if tolua.getpeer(tmp) == nil then
  170. tolua.setpeer(tmp, {})
  171. end
  172. self.slot2 = tmp
  173. end
  174. ---@private
  175. function SlotItemView:InitGenerate__10(Root, data)
  176. --[[
  177. CardPlus/CardsGrid/Slot2/Card2
  178. --]]
  179. local tmp = Root:Find("CardPlus/CardsGrid/Slot2/Card2").gameObject
  180. if tolua.getpeer(tmp) == nil then
  181. tolua.setpeer(tmp, {})
  182. end
  183. self.card2 = tmp
  184. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  185. end
  186. ---@private
  187. function SlotItemView:InitGenerate__11(Root, data)
  188. --[[
  189. CardPlus/CardsGrid/Slot3
  190. --]]
  191. local tmp = Root:Find("CardPlus/CardsGrid/Slot3").gameObject
  192. if tolua.getpeer(tmp) == nil then
  193. tolua.setpeer(tmp, {})
  194. end
  195. self.slot3 = tmp
  196. end
  197. ---@private
  198. function SlotItemView:InitGenerate__12(Root, data)
  199. --[[
  200. CardPlus/CardsGrid/Slot3/Card3
  201. --]]
  202. local tmp = Root:Find("CardPlus/CardsGrid/Slot3/Card3").gameObject
  203. if tolua.getpeer(tmp) == nil then
  204. tolua.setpeer(tmp, {})
  205. end
  206. self.card3 = tmp
  207. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  208. end
  209. ---@private
  210. function SlotItemView:InitGenerate__13(Root, data)
  211. --[[
  212. CardPlus/CardsGrid/Slot4
  213. --]]
  214. local tmp = Root:Find("CardPlus/CardsGrid/Slot4").gameObject
  215. if tolua.getpeer(tmp) == nil then
  216. tolua.setpeer(tmp, {})
  217. end
  218. self.slot4 = tmp
  219. end
  220. ---@private
  221. function SlotItemView:InitGenerate__14(Root, data)
  222. --[[
  223. CardPlus/CardsGrid/Slot4/Card4
  224. --]]
  225. local tmp = Root:Find("CardPlus/CardsGrid/Slot4/Card4").gameObject
  226. if tolua.getpeer(tmp) == nil then
  227. tolua.setpeer(tmp, {})
  228. end
  229. self.card4 = tmp
  230. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  231. end
  232. ---@private
  233. function SlotItemView:InitGenerate__15(Root, data)
  234. --[[
  235. lv
  236. --]]
  237. local tmp = Root:Find("lv").gameObject
  238. if tolua.getpeer(tmp) == nil then
  239. tolua.setpeer(tmp, {})
  240. end
  241. self.lv = tmp
  242. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  243. end
  244. ---@private
  245. function SlotItemView:InitGenerate__16(Root, data)
  246. --[[
  247. equipFx
  248. --]]
  249. local tmp = Root:Find("equipFx").gameObject
  250. if tolua.getpeer(tmp) == nil then
  251. tolua.setpeer(tmp, {})
  252. end
  253. self.equipFx = tmp
  254. tmp.uIParticle = tmp:GetComponent(Enum.TypeInfo.UIParticle)
  255. end
  256. ---@private
  257. function SlotItemView:InitGenerate__17(Root, data)
  258. --[[
  259. mask
  260. --]]
  261. local tmp = Root:Find("mask").gameObject
  262. if tolua.getpeer(tmp) == nil then
  263. tolua.setpeer(tmp, {})
  264. end
  265. self.mask = tmp
  266. end
  267. ---@private
  268. function SlotItemView:InitGenerate__18(Root, data)
  269. --[[
  270. RedPointItem
  271. --]]
  272. local tmp = Root:Find("RedPointItem").gameObject
  273. if tolua.getpeer(tmp) == nil then
  274. tolua.setpeer(tmp, {})
  275. end
  276. self.redPointItem = CommonUtil.BindGridViewItem2LuaStatic("RedPointItem", tmp)
  277. self.redPointItem.prefabName = "RedPointItem"
  278. end
  279. ---@private
  280. function SlotItemView:GenerateDestroy()
  281. if tolua.getpeer(self.button) ~= nil then
  282. tolua.setpeer(self.button, nil)
  283. end
  284. self.button = nil
  285. if tolua.getpeer(self.par) ~= nil then
  286. tolua.setpeer(self.par, nil)
  287. end
  288. self.par = nil
  289. if self.equipItem.GenerateDestroy ~= nil then
  290. self.equipItem:GenerateDestroy()
  291. end
  292. if tolua.getpeer(self.equipItem) ~= nil then
  293. tolua.setpeer(self.equipItem, nil)
  294. end
  295. self.equipItem = nil
  296. if tolua.getpeer(self.cardPlus) ~= nil then
  297. tolua.setpeer(self.cardPlus, nil)
  298. end
  299. self.cardPlus = nil
  300. if tolua.getpeer(self.bgPlus) ~= nil then
  301. tolua.setpeer(self.bgPlus, nil)
  302. end
  303. self.bgPlus = nil
  304. if tolua.getpeer(self.slot1) ~= nil then
  305. tolua.setpeer(self.slot1, nil)
  306. end
  307. self.slot1 = nil
  308. if tolua.getpeer(self.card1) ~= nil then
  309. tolua.setpeer(self.card1, nil)
  310. end
  311. self.card1 = nil
  312. if tolua.getpeer(self.slot2) ~= nil then
  313. tolua.setpeer(self.slot2, nil)
  314. end
  315. self.slot2 = nil
  316. if tolua.getpeer(self.card2) ~= nil then
  317. tolua.setpeer(self.card2, nil)
  318. end
  319. self.card2 = nil
  320. if tolua.getpeer(self.slot3) ~= nil then
  321. tolua.setpeer(self.slot3, nil)
  322. end
  323. self.slot3 = nil
  324. if tolua.getpeer(self.card3) ~= nil then
  325. tolua.setpeer(self.card3, nil)
  326. end
  327. self.card3 = nil
  328. if tolua.getpeer(self.slot4) ~= nil then
  329. tolua.setpeer(self.slot4, nil)
  330. end
  331. self.slot4 = nil
  332. if tolua.getpeer(self.card4) ~= nil then
  333. tolua.setpeer(self.card4, nil)
  334. end
  335. self.card4 = nil
  336. if tolua.getpeer(self.lv) ~= nil then
  337. tolua.setpeer(self.lv, nil)
  338. end
  339. self.lv = nil
  340. if tolua.getpeer(self.equipFx) ~= nil then
  341. tolua.setpeer(self.equipFx, nil)
  342. end
  343. self.equipFx = nil
  344. if tolua.getpeer(self.mask) ~= nil then
  345. tolua.setpeer(self.mask, nil)
  346. end
  347. self.mask = nil
  348. if self.redPointItem.GenerateDestroy ~= nil then
  349. self.redPointItem:GenerateDestroy()
  350. end
  351. if tolua.getpeer(self.redPointItem) ~= nil then
  352. tolua.setpeer(self.redPointItem, nil)
  353. end
  354. self.redPointItem = nil
  355. self.transform = nil
  356. self.gameObject = nil
  357. self.inited = false
  358. end
  359. return SlotItemView