NotifyItem_Generate.lua 4.2 KB

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