CardBook_Generate.lua 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. ---@class CardBook__Generate_btnBack
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public button UnityEngine.UI.Button
  4. ---@class CardBook__Generate_qty_text
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public text UnityEngine.UI.Text
  7. ---@class CardBook__Generate_qty
  8. ---@field public gameObject UnityEngine.GameObject
  9. ---@field public iconAll UnityEngine.GameObject
  10. ---@field public iconNormal UnityEngine.GameObject
  11. ---@field public iconMini UnityEngine.GameObject
  12. ---@field public iconMvp UnityEngine.GameObject
  13. ---@field public text CardBook__Generate_qty_text
  14. ---@class CardBook__Generate_toggleMVP
  15. ---@field public gameObject UnityEngine.GameObject
  16. ---@field public toggle UnityEngine.UI.Toggle
  17. ---@class CardBook__Generate_toggleMini
  18. ---@field public gameObject UnityEngine.GameObject
  19. ---@field public toggle UnityEngine.UI.Toggle
  20. ---@class CardBook__Generate_toggleNormal
  21. ---@field public gameObject UnityEngine.GameObject
  22. ---@field public toggle UnityEngine.UI.Toggle
  23. ---@class CardBook__Generate_toggleAll
  24. ---@field public gameObject UnityEngine.GameObject
  25. ---@field public toggle UnityEngine.UI.Toggle
  26. ---@class CardBook__Generate_toggleGroup
  27. ---@field public gameObject UnityEngine.GameObject
  28. ---@field public toggleGroup UnityEngine.UI.ToggleGroup
  29. ---@class CardBook__Generate_scrollView
  30. ---@field public gameObject UnityEngine.GameObject
  31. ---@field public loopGridView SuperScrollView.LoopGridView
  32. ---@class CardBook__Generate
  33. ---@field private gameObject UnityEngine.GameObject
  34. ---@field private transform UnityEngine.Transform
  35. ---@field private rectTransform UnityEngine.RectTransform
  36. ---@field private scrollView CardBook__Generate_scrollView
  37. ---@field private cardCollect UnityEngine.GameObject
  38. ---@field private toggleGroup CardBook__Generate_toggleGroup
  39. ---@field private toggleAll CardBook__Generate_toggleAll
  40. ---@field private toggleNormal CardBook__Generate_toggleNormal
  41. ---@field private toggleMini CardBook__Generate_toggleMini
  42. ---@field private toggleMVP CardBook__Generate_toggleMVP
  43. ---@field private qty CardBook__Generate_qty
  44. ---@field private btnBack CardBook__Generate_btnBack
  45. local CardBookView = class("CardBookView")
  46. function CardBookView:ctor()
  47. end
  48. ---@private
  49. function CardBookView:SetActive(result)
  50. self.gameObject:SetActive(result)
  51. end
  52. ---@private
  53. function CardBookView: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. end
  73. ---@private
  74. function CardBookView:InitGenerate__1(Root, data)
  75. --[[
  76. Root
  77. --]]
  78. self.rectTransform = Root:GetComponent(Enum.TypeInfo.RectTransform)
  79. end
  80. ---@private
  81. function CardBookView:InitGenerate__2(Root, data)
  82. --[[
  83. ScrollView
  84. --]]
  85. local tmp = Root:Find("ScrollView").gameObject
  86. if tolua.getpeer(tmp) == nil then
  87. tolua.setpeer(tmp, {})
  88. end
  89. self.scrollView = tmp
  90. tmp.loopGridView = tmp:GetComponent(Enum.TypeInfo.LoopGridView)
  91. end
  92. ---@private
  93. function CardBookView:InitGenerate__3(Root, data)
  94. --[[
  95. ScrollView/Viewport/Content/CardCollect
  96. --]]
  97. local tmp = Root:Find("ScrollView/Viewport/Content/CardCollect").gameObject
  98. if tolua.getpeer(tmp) == nil then
  99. tolua.setpeer(tmp, {})
  100. end
  101. self.cardCollect = CommonUtil.BindGridViewItem2LuaStatic("CardCollect", tmp)
  102. self.cardCollect.prefabName = "CardCollect"
  103. end
  104. ---@private
  105. function CardBookView:InitGenerate__4(Root, data)
  106. --[[
  107. ToggleGroup
  108. --]]
  109. local tmp = Root:Find("ToggleGroup").gameObject
  110. if tolua.getpeer(tmp) == nil then
  111. tolua.setpeer(tmp, {})
  112. end
  113. self.toggleGroup = tmp
  114. tmp.toggleGroup = tmp:GetComponent(Enum.TypeInfo.ToggleGroup)
  115. end
  116. ---@private
  117. function CardBookView:InitGenerate__5(Root, data)
  118. --[[
  119. ToggleGroup/ToggleAll
  120. --]]
  121. local tmp = Root:Find("ToggleGroup/ToggleAll").gameObject
  122. if tolua.getpeer(tmp) == nil then
  123. tolua.setpeer(tmp, {})
  124. end
  125. self.toggleAll = tmp
  126. tmp.toggle = tmp:GetComponent(Enum.TypeInfo.Toggle)
  127. end
  128. ---@private
  129. function CardBookView:InitGenerate__6(Root, data)
  130. --[[
  131. ToggleGroup/ToggleNormal
  132. --]]
  133. local tmp = Root:Find("ToggleGroup/ToggleNormal").gameObject
  134. if tolua.getpeer(tmp) == nil then
  135. tolua.setpeer(tmp, {})
  136. end
  137. self.toggleNormal = tmp
  138. tmp.toggle = tmp:GetComponent(Enum.TypeInfo.Toggle)
  139. end
  140. ---@private
  141. function CardBookView:InitGenerate__7(Root, data)
  142. --[[
  143. ToggleGroup/ToggleMini
  144. --]]
  145. local tmp = Root:Find("ToggleGroup/ToggleMini").gameObject
  146. if tolua.getpeer(tmp) == nil then
  147. tolua.setpeer(tmp, {})
  148. end
  149. self.toggleMini = tmp
  150. tmp.toggle = tmp:GetComponent(Enum.TypeInfo.Toggle)
  151. end
  152. ---@private
  153. function CardBookView:InitGenerate__8(Root, data)
  154. --[[
  155. ToggleGroup/ToggleMVP
  156. --]]
  157. local tmp = Root:Find("ToggleGroup/ToggleMVP").gameObject
  158. if tolua.getpeer(tmp) == nil then
  159. tolua.setpeer(tmp, {})
  160. end
  161. self.toggleMVP = tmp
  162. tmp.toggle = tmp:GetComponent(Enum.TypeInfo.Toggle)
  163. end
  164. ---@private
  165. function CardBookView:InitGenerate__9(Root, data)
  166. --[[
  167. Qty
  168. --]]
  169. local tmp = Root:Find("Qty").gameObject
  170. if tolua.getpeer(tmp) == nil then
  171. tolua.setpeer(tmp, {})
  172. end
  173. self.qty = tmp
  174. end
  175. ---@private
  176. function CardBookView:InitGenerate__10(Root, data)
  177. --[[
  178. Qty/IconAll
  179. --]]
  180. local tmp = Root:Find("Qty/IconAll").gameObject
  181. if tolua.getpeer(tmp) == nil then
  182. tolua.setpeer(tmp, {})
  183. end
  184. self.qty.iconAll = tmp
  185. end
  186. ---@private
  187. function CardBookView:InitGenerate__11(Root, data)
  188. --[[
  189. Qty/IconNormal
  190. --]]
  191. local tmp = Root:Find("Qty/IconNormal").gameObject
  192. if tolua.getpeer(tmp) == nil then
  193. tolua.setpeer(tmp, {})
  194. end
  195. self.qty.iconNormal = tmp
  196. end
  197. ---@private
  198. function CardBookView:InitGenerate__12(Root, data)
  199. --[[
  200. Qty/IconMini
  201. --]]
  202. local tmp = Root:Find("Qty/IconMini").gameObject
  203. if tolua.getpeer(tmp) == nil then
  204. tolua.setpeer(tmp, {})
  205. end
  206. self.qty.iconMini = tmp
  207. end
  208. ---@private
  209. function CardBookView:InitGenerate__13(Root, data)
  210. --[[
  211. Qty/IconMvp
  212. --]]
  213. local tmp = Root:Find("Qty/IconMvp").gameObject
  214. if tolua.getpeer(tmp) == nil then
  215. tolua.setpeer(tmp, {})
  216. end
  217. self.qty.iconMvp = tmp
  218. end
  219. ---@private
  220. function CardBookView:InitGenerate__14(Root, data)
  221. --[[
  222. Qty/Text
  223. --]]
  224. local tmp = Root:Find("Qty/Text").gameObject
  225. if tolua.getpeer(tmp) == nil then
  226. tolua.setpeer(tmp, {})
  227. end
  228. self.qty.text = tmp
  229. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  230. end
  231. ---@private
  232. function CardBookView:InitGenerate__15(Root, data)
  233. --[[
  234. BtnBack
  235. --]]
  236. local tmp = Root:Find("BtnBack").gameObject
  237. if tolua.getpeer(tmp) == nil then
  238. tolua.setpeer(tmp, {})
  239. end
  240. self.btnBack = tmp
  241. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  242. end
  243. ---@private
  244. function CardBookView:GenerateDestroy()
  245. if tolua.getpeer(self.qty.text) ~= nil then
  246. tolua.setpeer(self.qty.text, nil)
  247. end
  248. if tolua.getpeer(self.qty.iconMvp) ~= nil then
  249. tolua.setpeer(self.qty.iconMvp, nil)
  250. end
  251. if tolua.getpeer(self.qty.iconMini) ~= nil then
  252. tolua.setpeer(self.qty.iconMini, nil)
  253. end
  254. if tolua.getpeer(self.qty.iconNormal) ~= nil then
  255. tolua.setpeer(self.qty.iconNormal, nil)
  256. end
  257. if tolua.getpeer(self.qty.iconAll) ~= nil then
  258. tolua.setpeer(self.qty.iconAll, nil)
  259. end
  260. if tolua.getpeer(self.scrollView) ~= nil then
  261. tolua.setpeer(self.scrollView, nil)
  262. end
  263. self.scrollView = nil
  264. if self.cardCollect.GenerateDestroy ~= nil then
  265. self.cardCollect:GenerateDestroy()
  266. end
  267. if tolua.getpeer(self.cardCollect) ~= nil then
  268. tolua.setpeer(self.cardCollect, nil)
  269. end
  270. self.cardCollect = nil
  271. if tolua.getpeer(self.toggleGroup) ~= nil then
  272. tolua.setpeer(self.toggleGroup, nil)
  273. end
  274. self.toggleGroup = nil
  275. if tolua.getpeer(self.toggleAll) ~= nil then
  276. tolua.setpeer(self.toggleAll, nil)
  277. end
  278. self.toggleAll = nil
  279. if tolua.getpeer(self.toggleNormal) ~= nil then
  280. tolua.setpeer(self.toggleNormal, nil)
  281. end
  282. self.toggleNormal = nil
  283. if tolua.getpeer(self.toggleMini) ~= nil then
  284. tolua.setpeer(self.toggleMini, nil)
  285. end
  286. self.toggleMini = nil
  287. if tolua.getpeer(self.toggleMVP) ~= nil then
  288. tolua.setpeer(self.toggleMVP, nil)
  289. end
  290. self.toggleMVP = nil
  291. if tolua.getpeer(self.qty) ~= nil then
  292. tolua.setpeer(self.qty, nil)
  293. end
  294. self.qty = nil
  295. if tolua.getpeer(self.btnBack) ~= nil then
  296. tolua.setpeer(self.btnBack, nil)
  297. end
  298. self.btnBack = nil
  299. self.transform = nil
  300. self.gameObject = nil
  301. self.inited = false
  302. end
  303. return CardBookView