ShopGoodsItem_Generate.lua 11 KB

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