StudentListItem_Generate.lua 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. ---@class StudentListItem__Generate_headItem
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public layoutElement UnityEngine.UI.LayoutElement
  4. ---@class StudentListItem__Generate_playerName
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public text UnityEngine.UI.Text
  7. ---@class StudentListItem__Generate_playerFollow
  8. ---@field public gameObject UnityEngine.GameObject
  9. ---@field public image UnityEngine.UI.Image
  10. ---@field public switchSprite SwitchSprite
  11. ---@class StudentListItem__Generate_clapBtn
  12. ---@field public gameObject UnityEngine.GameObject
  13. ---@field public button UnityEngine.UI.Button
  14. ---@field public image UnityEngine.GameObject
  15. ---@class StudentListItem__Generate_statusLbl
  16. ---@field public gameObject UnityEngine.GameObject
  17. ---@field public text UnityEngine.UI.Text
  18. ---@class StudentListItem__Generate_statusImg
  19. ---@field public gameObject UnityEngine.GameObject
  20. ---@field public image UnityEngine.UI.Image
  21. ---@class StudentListItem__Generate_recruitValueNum
  22. ---@field public gameObject UnityEngine.GameObject
  23. ---@field public text UnityEngine.UI.Text
  24. ---@class StudentListItem__Generate
  25. ---@field private gameObject UnityEngine.GameObject
  26. ---@field private transform UnityEngine.Transform
  27. ---@field private recruitValueNum StudentListItem__Generate_recruitValueNum
  28. ---@field private statusImg StudentListItem__Generate_statusImg
  29. ---@field private statusLbl StudentListItem__Generate_statusLbl
  30. ---@field private recruitBtnsGroup UnityEngine.GameObject
  31. ---@field private clapBtn StudentListItem__Generate_clapBtn
  32. ---@field private graduated UnityEngine.GameObject
  33. ---@field private label UnityEngine.GameObject
  34. ---@field private playerFollow StudentListItem__Generate_playerFollow
  35. ---@field private playerName StudentListItem__Generate_playerName
  36. ---@field private headItem StudentListItem__Generate_headItem
  37. local StudentListItemView = class("StudentListItemView")
  38. function StudentListItemView:ctor()
  39. end
  40. ---@private
  41. function StudentListItemView:SetActive(result)
  42. self.gameObject:SetActive(result)
  43. end
  44. ---@private
  45. function StudentListItemView:InitGenerate(Root, data)
  46. self.transform = Root
  47. self.inited = true
  48. local tmp
  49. self:InitGenerate__1(Root,data)
  50. self:InitGenerate__2(Root,data)
  51. self:InitGenerate__3(Root,data)
  52. self:InitGenerate__4(Root,data)
  53. self:InitGenerate__5(Root,data)
  54. self:InitGenerate__6(Root,data)
  55. self:InitGenerate__7(Root,data)
  56. self:InitGenerate__8(Root,data)
  57. self:InitGenerate__9(Root,data)
  58. self:InitGenerate__10(Root,data)
  59. self:InitGenerate__11(Root,data)
  60. end
  61. ---@private
  62. function StudentListItemView:InitGenerate__1(Root, data)
  63. --[[
  64. RecruitValueBg/RecruitValueNum
  65. --]]
  66. local tmp = Root:Find("RecruitValueBg/RecruitValueNum").gameObject
  67. if tolua.getpeer(tmp) == nil then
  68. tolua.setpeer(tmp, {})
  69. end
  70. self.recruitValueNum = tmp
  71. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  72. end
  73. ---@private
  74. function StudentListItemView:InitGenerate__2(Root, data)
  75. --[[
  76. StatusBg/StatusImg
  77. --]]
  78. local tmp = Root:Find("StatusBg/StatusImg").gameObject
  79. if tolua.getpeer(tmp) == nil then
  80. tolua.setpeer(tmp, {})
  81. end
  82. self.statusImg = tmp
  83. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  84. end
  85. ---@private
  86. function StudentListItemView:InitGenerate__3(Root, data)
  87. --[[
  88. StatusBg/StatusLbl
  89. --]]
  90. local tmp = Root:Find("StatusBg/StatusLbl").gameObject
  91. if tolua.getpeer(tmp) == nil then
  92. tolua.setpeer(tmp, {})
  93. end
  94. self.statusLbl = tmp
  95. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  96. end
  97. ---@private
  98. function StudentListItemView:InitGenerate__4(Root, data)
  99. --[[
  100. RecruitBtnsGroup
  101. --]]
  102. local tmp = Root:Find("RecruitBtnsGroup").gameObject
  103. if tolua.getpeer(tmp) == nil then
  104. tolua.setpeer(tmp, {})
  105. end
  106. self.recruitBtnsGroup = tmp
  107. end
  108. ---@private
  109. function StudentListItemView:InitGenerate__5(Root, data)
  110. --[[
  111. RecruitBtnsGroup/ClapBtn
  112. --]]
  113. local tmp = Root:Find("RecruitBtnsGroup/ClapBtn").gameObject
  114. if tolua.getpeer(tmp) == nil then
  115. tolua.setpeer(tmp, {})
  116. end
  117. self.clapBtn = tmp
  118. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  119. end
  120. ---@private
  121. function StudentListItemView:InitGenerate__6(Root, data)
  122. --[[
  123. RecruitBtnsGroup/ClapBtn/image
  124. --]]
  125. local tmp = Root:Find("RecruitBtnsGroup/ClapBtn/image").gameObject
  126. if tolua.getpeer(tmp) == nil then
  127. tolua.setpeer(tmp, {})
  128. end
  129. self.clapBtn.image = tmp
  130. end
  131. ---@private
  132. function StudentListItemView:InitGenerate__7(Root, data)
  133. --[[
  134. RecruitBtnsGroup/Graduated
  135. --]]
  136. local tmp = Root:Find("RecruitBtnsGroup/Graduated").gameObject
  137. if tolua.getpeer(tmp) == nil then
  138. tolua.setpeer(tmp, {})
  139. end
  140. self.graduated = tmp
  141. end
  142. ---@private
  143. function StudentListItemView:InitGenerate__8(Root, data)
  144. --[[
  145. RecruitBtnsGroup/Graduated/Label
  146. --]]
  147. local tmp = Root:Find("RecruitBtnsGroup/Graduated/Label").gameObject
  148. if tolua.getpeer(tmp) == nil then
  149. tolua.setpeer(tmp, {})
  150. end
  151. self.label = tmp
  152. end
  153. ---@private
  154. function StudentListItemView:InitGenerate__9(Root, data)
  155. --[[
  156. NameGroup/FollowImg
  157. --]]
  158. local tmp = Root:Find("NameGroup/FollowImg").gameObject
  159. if tolua.getpeer(tmp) == nil then
  160. tolua.setpeer(tmp, {})
  161. end
  162. self.playerFollow = tmp
  163. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  164. tmp.switchSprite = tmp:GetComponent(Enum.TypeInfo.SwitchSprite)
  165. end
  166. ---@private
  167. function StudentListItemView:InitGenerate__10(Root, data)
  168. --[[
  169. NameGroup/Name
  170. --]]
  171. local tmp = Root:Find("NameGroup/Name").gameObject
  172. if tolua.getpeer(tmp) == nil then
  173. tolua.setpeer(tmp, {})
  174. end
  175. self.playerName = tmp
  176. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  177. end
  178. ---@private
  179. function StudentListItemView:InitGenerate__11(Root, data)
  180. --[[
  181. HeadItem
  182. --]]
  183. local tmp = Root:Find("HeadItem").gameObject
  184. if tolua.getpeer(tmp) == nil then
  185. tolua.setpeer(tmp, {})
  186. end
  187. self.headItem = CommonUtil.BindGridViewItem2LuaStatic("HeadItem", tmp)
  188. self.headItem.prefabName = "HeadItem"
  189. tmp.layoutElement = tmp:GetComponent(Enum.TypeInfo.LayoutElement)
  190. end
  191. ---@private
  192. function StudentListItemView:GenerateDestroy()
  193. if tolua.getpeer(self.clapBtn.image) ~= nil then
  194. tolua.setpeer(self.clapBtn.image, nil)
  195. end
  196. if tolua.getpeer(self.recruitValueNum) ~= nil then
  197. tolua.setpeer(self.recruitValueNum, nil)
  198. end
  199. self.recruitValueNum = nil
  200. if tolua.getpeer(self.statusImg) ~= nil then
  201. tolua.setpeer(self.statusImg, nil)
  202. end
  203. self.statusImg = nil
  204. if tolua.getpeer(self.statusLbl) ~= nil then
  205. tolua.setpeer(self.statusLbl, nil)
  206. end
  207. self.statusLbl = nil
  208. if tolua.getpeer(self.recruitBtnsGroup) ~= nil then
  209. tolua.setpeer(self.recruitBtnsGroup, nil)
  210. end
  211. self.recruitBtnsGroup = nil
  212. if tolua.getpeer(self.clapBtn) ~= nil then
  213. tolua.setpeer(self.clapBtn, nil)
  214. end
  215. self.clapBtn = nil
  216. if tolua.getpeer(self.graduated) ~= nil then
  217. tolua.setpeer(self.graduated, nil)
  218. end
  219. self.graduated = nil
  220. if tolua.getpeer(self.label) ~= nil then
  221. tolua.setpeer(self.label, nil)
  222. end
  223. self.label = nil
  224. if tolua.getpeer(self.playerFollow) ~= nil then
  225. tolua.setpeer(self.playerFollow, nil)
  226. end
  227. self.playerFollow = nil
  228. if tolua.getpeer(self.playerName) ~= nil then
  229. tolua.setpeer(self.playerName, nil)
  230. end
  231. self.playerName = nil
  232. if self.headItem.GenerateDestroy ~= nil then
  233. self.headItem:GenerateDestroy()
  234. end
  235. if tolua.getpeer(self.headItem) ~= nil then
  236. tolua.setpeer(self.headItem, nil)
  237. end
  238. self.headItem = nil
  239. self.transform = nil
  240. self.gameObject = nil
  241. self.inited = false
  242. end
  243. return StudentListItemView