UIMinTipsView_Generate.lua 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. ---@class UIMinTips__Generate_templateItem
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public rectTransform UnityEngine.RectTransform
  4. ---@class UIMinTips__Generate_iconsNode
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public rectTransform UnityEngine.RectTransform
  7. ---@field public gridLayoutGroup UnityEngine.UI.GridLayoutGroup
  8. ---@class UIMinTips__Generate_content
  9. ---@field public gameObject UnityEngine.GameObject
  10. ---@field public text UnityEngine.UI.Text
  11. ---@class UIMinTips__Generate_bg
  12. ---@field public gameObject UnityEngine.GameObject
  13. ---@field public rectTransform UnityEngine.RectTransform
  14. ---@class UIMinTips__Generate_node
  15. ---@field public gameObject UnityEngine.GameObject
  16. ---@field public rectTransform UnityEngine.RectTransform
  17. ---@class UIMinTips__Generate
  18. ---@field private gameObject UnityEngine.GameObject
  19. ---@field private transform UnityEngine.Transform
  20. ---@field private node UIMinTips__Generate_node
  21. ---@field private bg UIMinTips__Generate_bg
  22. ---@field private content UIMinTips__Generate_content
  23. ---@field private iconsNode UIMinTips__Generate_iconsNode
  24. ---@field private templateItem UIMinTips__Generate_templateItem
  25. local UIMinTipsView = class("UIMinTipsView", require("UIViewBase"))
  26. function UIMinTipsView:ctor()
  27. end
  28. ---@private
  29. function UIMinTipsView:SetActive(result)
  30. self.gameObject:SetActive(result)
  31. end
  32. ---@private
  33. function UIMinTipsView:InitGenerate(Root, data)
  34. self.transform = Root
  35. self.inited = true
  36. if self.super.Init then
  37. self.super.Init(self)
  38. end
  39. local tmp
  40. self:InitGenerate__1(Root,data)
  41. self:InitGenerate__2(Root,data)
  42. self:InitGenerate__3(Root,data)
  43. self:InitGenerate__4(Root,data)
  44. self:InitGenerate__5(Root,data)
  45. end
  46. ---@private
  47. function UIMinTipsView:InitGenerate__1(Root, data)
  48. --[[
  49. Node
  50. --]]
  51. local tmp = Root:Find("Node").gameObject
  52. if tolua.getpeer(tmp) == nil then
  53. tolua.setpeer(tmp, {})
  54. end
  55. self.node = tmp
  56. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  57. end
  58. ---@private
  59. function UIMinTipsView:InitGenerate__2(Root, data)
  60. --[[
  61. Node/BG
  62. --]]
  63. local tmp = Root:Find("Node/BG").gameObject
  64. if tolua.getpeer(tmp) == nil then
  65. tolua.setpeer(tmp, {})
  66. end
  67. self.bg = tmp
  68. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  69. end
  70. ---@private
  71. function UIMinTipsView:InitGenerate__3(Root, data)
  72. --[[
  73. Node/BG/Text
  74. --]]
  75. local tmp = Root:Find("Node/BG/Text").gameObject
  76. if tolua.getpeer(tmp) == nil then
  77. tolua.setpeer(tmp, {})
  78. end
  79. self.content = tmp
  80. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  81. end
  82. ---@private
  83. function UIMinTipsView:InitGenerate__4(Root, data)
  84. --[[
  85. Node/BG/Icons
  86. --]]
  87. local tmp = Root:Find("Node/BG/Icons").gameObject
  88. if tolua.getpeer(tmp) == nil then
  89. tolua.setpeer(tmp, {})
  90. end
  91. self.iconsNode = tmp
  92. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  93. tmp.gridLayoutGroup = tmp:GetComponent(Enum.TypeInfo.GridLayoutGroup)
  94. end
  95. ---@private
  96. function UIMinTipsView:InitGenerate__5(Root, data)
  97. --[[
  98. Node/BG/Icons/TipItem
  99. --]]
  100. local tmp = Root:Find("Node/BG/Icons/TipItem").gameObject
  101. if tolua.getpeer(tmp) == nil then
  102. tolua.setpeer(tmp, {})
  103. end
  104. self.templateItem = CommonUtil.BindGridViewItem2LuaStatic("TipItem", tmp)
  105. self.templateItem.prefabName = "TipItem"
  106. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  107. end
  108. ---@private
  109. function UIMinTipsView:GenerateDestroy()
  110. if tolua.getpeer(self.node) ~= nil then
  111. tolua.setpeer(self.node, nil)
  112. end
  113. self.node = nil
  114. if tolua.getpeer(self.bg) ~= nil then
  115. tolua.setpeer(self.bg, nil)
  116. end
  117. self.bg = nil
  118. if tolua.getpeer(self.content) ~= nil then
  119. tolua.setpeer(self.content, nil)
  120. end
  121. self.content = nil
  122. if tolua.getpeer(self.iconsNode) ~= nil then
  123. tolua.setpeer(self.iconsNode, nil)
  124. end
  125. self.iconsNode = nil
  126. if self.templateItem.GenerateDestroy ~= nil then
  127. self.templateItem:GenerateDestroy()
  128. end
  129. if tolua.getpeer(self.templateItem) ~= nil then
  130. tolua.setpeer(self.templateItem, nil)
  131. end
  132. self.templateItem = nil
  133. self.transform = nil
  134. self.gameObject = nil
  135. self.inited = false
  136. end
  137. return UIMinTipsView