UICardGotView_Generate.lua 3.7 KB

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