UIPOPGotView_Generate.lua 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ---@class UIPOPGot__Generate_iconItem
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public rectTransform UnityEngine.RectTransform
  4. ---@field public layoutElement UnityEngine.UI.LayoutElement
  5. ---@class UIPOPGot__Generate_titleNode
  6. ---@field public gameObject UnityEngine.GameObject
  7. ---@field public text TMPro.TextMeshProUGUI
  8. ---@field public uILocalizeScript UILocalizeScript
  9. ---@class UIPOPGot__Generate_scrollView
  10. ---@field public gameObject UnityEngine.GameObject
  11. ---@field public loopVerticalScrollRect UnityEngine.UI.LoopVerticalScrollRect
  12. ---@class UIPOPGot__Generate_AnyBtn
  13. ---@field public gameObject UnityEngine.GameObject
  14. ---@field public button UnityEngine.UI.Button
  15. ---@class UIPOPGot__Generate_uIAnimator
  16. ---@field public gameObject UnityEngine.GameObject
  17. ---@field public animator UnityEngine.Animator
  18. ---@class UIPOPGot__Generate
  19. ---@field private gameObject UnityEngine.GameObject
  20. ---@field private transform UnityEngine.Transform
  21. ---@field private uIAnimator UIPOPGot__Generate_uIAnimator
  22. ---@field private AnyBtn UIPOPGot__Generate_AnyBtn
  23. ---@field private scrollView UIPOPGot__Generate_scrollView
  24. ---@field private titleNode UIPOPGot__Generate_titleNode
  25. ---@field private iconItem UIPOPGot__Generate_iconItem
  26. local UIPOPGotView = class("UIPOPGotView", require("UIViewBase"))
  27. function UIPOPGotView:ctor()
  28. end
  29. ---@private
  30. function UIPOPGotView:SetActive(result)
  31. self.gameObject:SetActive(result)
  32. end
  33. ---@private
  34. function UIPOPGotView:InitGenerate(Root, data)
  35. self.transform = Root
  36. self.inited = true
  37. if self.super.Init then
  38. self.super.Init(self)
  39. end
  40. local tmp
  41. self:InitGenerate__1(Root,data)
  42. self:InitGenerate__2(Root,data)
  43. self:InitGenerate__3(Root,data)
  44. self:InitGenerate__4(Root,data)
  45. self:InitGenerate__5(Root,data)
  46. end
  47. ---@private
  48. function UIPOPGotView:InitGenerate__1(Root, data)
  49. --[[
  50. UIAnimator
  51. --]]
  52. local tmp = Root:Find("UIAnimator").gameObject
  53. if tolua.getpeer(tmp) == nil then
  54. tolua.setpeer(tmp, {})
  55. end
  56. self.uIAnimator = tmp
  57. tmp.animator = tmp:GetComponent(Enum.TypeInfo.Animator)
  58. tmp.animator.logWarnings = false
  59. end
  60. ---@private
  61. function UIPOPGotView:InitGenerate__2(Root, data)
  62. --[[
  63. UIAnimator/Alpha
  64. --]]
  65. local tmp = Root:Find("UIAnimator/Alpha").gameObject
  66. if tolua.getpeer(tmp) == nil then
  67. tolua.setpeer(tmp, {})
  68. end
  69. self.AnyBtn = tmp
  70. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  71. end
  72. ---@private
  73. function UIPOPGotView:InitGenerate__3(Root, data)
  74. --[[
  75. UIAnimator/Window/ScrollView
  76. --]]
  77. local tmp = Root:Find("UIAnimator/Window/ScrollView").gameObject
  78. if tolua.getpeer(tmp) == nil then
  79. tolua.setpeer(tmp, {})
  80. end
  81. self.scrollView = tmp
  82. tmp.loopVerticalScrollRect = tmp:GetComponent(Enum.TypeInfo.LoopVerticalScrollRect)
  83. end
  84. ---@private
  85. function UIPOPGotView:InitGenerate__4(Root, data)
  86. --[[
  87. UIAnimator/Window/ScrollView/Bg/Title/Image/Text
  88. --]]
  89. local tmp = Root:Find("UIAnimator/Window/ScrollView/Bg/Title/Image/Text").gameObject
  90. if tolua.getpeer(tmp) == nil then
  91. tolua.setpeer(tmp, {})
  92. end
  93. self.titleNode = tmp
  94. tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
  95. tmp.uILocalizeScript = tmp:GetComponent(Enum.TypeInfo.UILocalizeScript)
  96. end
  97. ---@private
  98. function UIPOPGotView:InitGenerate__5(Root, data)
  99. --[[
  100. UIAnimator/Window/ScrollView/Viewport/IconItem
  101. --]]
  102. local tmp = Root:Find("UIAnimator/Window/ScrollView/Viewport/IconItem").gameObject
  103. if tolua.getpeer(tmp) == nil then
  104. tolua.setpeer(tmp, {})
  105. end
  106. self.iconItem = CommonUtil.BindGridViewItem2LuaStatic("IconItem", tmp)
  107. self.iconItem.prefabName = "IconItem"
  108. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  109. tmp.layoutElement = tmp:GetComponent(Enum.TypeInfo.LayoutElement)
  110. end
  111. ---@private
  112. function UIPOPGotView:GenerateDestroy()
  113. if tolua.getpeer(self.uIAnimator) ~= nil then
  114. tolua.setpeer(self.uIAnimator, nil)
  115. end
  116. self.uIAnimator = nil
  117. if tolua.getpeer(self.AnyBtn) ~= nil then
  118. tolua.setpeer(self.AnyBtn, nil)
  119. end
  120. self.AnyBtn = nil
  121. if tolua.getpeer(self.scrollView) ~= nil then
  122. tolua.setpeer(self.scrollView, nil)
  123. end
  124. self.scrollView = nil
  125. if tolua.getpeer(self.titleNode) ~= nil then
  126. tolua.setpeer(self.titleNode, nil)
  127. end
  128. self.titleNode = nil
  129. if self.iconItem.GenerateDestroy ~= nil then
  130. self.iconItem:GenerateDestroy()
  131. end
  132. if tolua.getpeer(self.iconItem) ~= nil then
  133. tolua.setpeer(self.iconItem, nil)
  134. end
  135. self.iconItem = nil
  136. self.transform = nil
  137. self.gameObject = nil
  138. self.inited = false
  139. end
  140. return UIPOPGotView