WishBoxListItem222_Generate.lua 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. ---@class WishBoxListItem222__Generate_desText
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public text UnityEngine.UI.Text
  4. ---@class WishBoxListItem222__Generate_textName
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public text UnityEngine.UI.Text
  7. ---@class WishBoxListItem222__Generate_iconItem
  8. ---@field public gameObject UnityEngine.GameObject
  9. ---@field public rectTransform UnityEngine.RectTransform
  10. ---@field public layoutElement UnityEngine.UI.LayoutElement
  11. ---@class WishBoxListItem222__Generate
  12. ---@field private gameObject UnityEngine.GameObject
  13. ---@field private transform UnityEngine.Transform
  14. ---@field private button UnityEngine.UI.Button
  15. ---@field private contentItem UnityEngine.GameObject
  16. ---@field private iconItem WishBoxListItem222__Generate_iconItem
  17. ---@field private textName WishBoxListItem222__Generate_textName
  18. ---@field private desBox UnityEngine.GameObject
  19. ---@field private desText WishBoxListItem222__Generate_desText
  20. ---@field private selected UnityEngine.GameObject
  21. local WishBoxListItem222View = class("WishBoxListItem222View")
  22. function WishBoxListItem222View:ctor()
  23. end
  24. ---@private
  25. function WishBoxListItem222View:SetActive(result)
  26. self.gameObject:SetActive(result)
  27. end
  28. ---@private
  29. function WishBoxListItem222View:InitGenerate(Root, data)
  30. self.transform = Root
  31. self.inited = true
  32. local tmp
  33. self:InitGenerate__1(Root,data)
  34. self:InitGenerate__2(Root,data)
  35. self:InitGenerate__3(Root,data)
  36. self:InitGenerate__4(Root,data)
  37. self:InitGenerate__5(Root,data)
  38. self:InitGenerate__6(Root,data)
  39. self:InitGenerate__7(Root,data)
  40. end
  41. ---@private
  42. function WishBoxListItem222View:InitGenerate__1(Root, data)
  43. --[[
  44. Root
  45. --]]
  46. self.button = Root:GetComponent(Enum.TypeInfo.Button)
  47. end
  48. ---@private
  49. function WishBoxListItem222View:InitGenerate__2(Root, data)
  50. --[[
  51. ContentItem
  52. --]]
  53. local tmp = Root:Find("ContentItem").gameObject
  54. if tolua.getpeer(tmp) == nil then
  55. tolua.setpeer(tmp, {})
  56. end
  57. self.contentItem = tmp
  58. end
  59. ---@private
  60. function WishBoxListItem222View:InitGenerate__3(Root, data)
  61. --[[
  62. ContentItem/IconItem
  63. --]]
  64. local tmp = Root:Find("ContentItem/IconItem").gameObject
  65. if tolua.getpeer(tmp) == nil then
  66. tolua.setpeer(tmp, {})
  67. end
  68. self.iconItem = CommonUtil.BindGridViewItem2LuaStatic("IconItem", tmp)
  69. self.iconItem.prefabName = "IconItem"
  70. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  71. tmp.layoutElement = tmp:GetComponent(Enum.TypeInfo.LayoutElement)
  72. end
  73. ---@private
  74. function WishBoxListItem222View:InitGenerate__4(Root, data)
  75. --[[
  76. TextName
  77. --]]
  78. local tmp = Root:Find("TextName").gameObject
  79. if tolua.getpeer(tmp) == nil then
  80. tolua.setpeer(tmp, {})
  81. end
  82. self.textName = tmp
  83. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  84. end
  85. ---@private
  86. function WishBoxListItem222View:InitGenerate__5(Root, data)
  87. --[[
  88. DesBox
  89. --]]
  90. local tmp = Root:Find("DesBox").gameObject
  91. if tolua.getpeer(tmp) == nil then
  92. tolua.setpeer(tmp, {})
  93. end
  94. self.desBox = tmp
  95. end
  96. ---@private
  97. function WishBoxListItem222View:InitGenerate__6(Root, data)
  98. --[[
  99. DesBox/Viewport/Content/DesText
  100. --]]
  101. local tmp = Root:Find("DesBox/Viewport/Content/DesText").gameObject
  102. if tolua.getpeer(tmp) == nil then
  103. tolua.setpeer(tmp, {})
  104. end
  105. self.desText = tmp
  106. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  107. end
  108. ---@private
  109. function WishBoxListItem222View:InitGenerate__7(Root, data)
  110. --[[
  111. Selected
  112. --]]
  113. local tmp = Root:Find("Selected").gameObject
  114. if tolua.getpeer(tmp) == nil then
  115. tolua.setpeer(tmp, {})
  116. end
  117. self.selected = tmp
  118. end
  119. ---@private
  120. function WishBoxListItem222View:GenerateDestroy()
  121. if tolua.getpeer(self.desText) ~= nil then
  122. tolua.setpeer(self.desText, nil)
  123. end
  124. if tolua.getpeer(self.contentItem) ~= nil then
  125. tolua.setpeer(self.contentItem, nil)
  126. end
  127. self.contentItem = nil
  128. if self.iconItem.GenerateDestroy ~= nil then
  129. self.iconItem:GenerateDestroy()
  130. end
  131. if tolua.getpeer(self.iconItem) ~= nil then
  132. tolua.setpeer(self.iconItem, nil)
  133. end
  134. self.iconItem = nil
  135. if tolua.getpeer(self.textName) ~= nil then
  136. tolua.setpeer(self.textName, nil)
  137. end
  138. self.textName = nil
  139. if tolua.getpeer(self.desBox) ~= nil then
  140. tolua.setpeer(self.desBox, nil)
  141. end
  142. self.desBox = nil
  143. if tolua.getpeer(self.selected) ~= nil then
  144. tolua.setpeer(self.selected, nil)
  145. end
  146. self.selected = nil
  147. self.transform = nil
  148. self.gameObject = nil
  149. self.inited = false
  150. end
  151. return WishBoxListItem222View