UIFuncMenuView_Generate.lua 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ---@class UIFuncMenu__Generate_btn_text
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public text TMPro.TextMeshProUGUI
  4. ---@class UIFuncMenu__Generate_btn
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public button UnityEngine.UI.Button
  7. ---@field public text UIFuncMenu__Generate_btn_text
  8. ---@class UIFuncMenu__Generate_btnContainer
  9. ---@field public gameObject UnityEngine.GameObject
  10. ---@field public rectTransform UnityEngine.RectTransform
  11. ---@field public verticalLayoutGroup UnityEngine.UI.VerticalLayoutGroup
  12. ---@field public contentSizeFitter UnityEngine.UI.ContentSizeFitter
  13. ---@class UIFuncMenu__Generate_mask
  14. ---@field public gameObject UnityEngine.GameObject
  15. ---@field public button UnityEngine.UI.Button
  16. ---@class UIFuncMenu__Generate
  17. ---@field private gameObject UnityEngine.GameObject
  18. ---@field private transform UnityEngine.Transform
  19. ---@field private mask UIFuncMenu__Generate_mask
  20. ---@field private btnContainer UIFuncMenu__Generate_btnContainer
  21. ---@field private btn UIFuncMenu__Generate_btn
  22. local UIFuncMenuView = class("UIFuncMenuView", require("UIViewBase"))
  23. function UIFuncMenuView:ctor()
  24. end
  25. ---@private
  26. function UIFuncMenuView:SetActive(result)
  27. self.gameObject:SetActive(result)
  28. end
  29. ---@private
  30. function UIFuncMenuView:InitGenerate(Root, data)
  31. self.transform = Root
  32. self.inited = true
  33. if self.super.Init then
  34. self.super.Init(self)
  35. end
  36. local tmp
  37. self:InitGenerate__1(Root,data)
  38. self:InitGenerate__2(Root,data)
  39. self:InitGenerate__3(Root,data)
  40. self:InitGenerate__4(Root,data)
  41. end
  42. ---@private
  43. function UIFuncMenuView:InitGenerate__1(Root, data)
  44. --[[
  45. Mask
  46. --]]
  47. local tmp = Root:Find("Mask").gameObject
  48. if tolua.getpeer(tmp) == nil then
  49. tolua.setpeer(tmp, {})
  50. end
  51. self.mask = tmp
  52. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  53. end
  54. ---@private
  55. function UIFuncMenuView:InitGenerate__2(Root, data)
  56. --[[
  57. BtnContainer
  58. --]]
  59. local tmp = Root:Find("BtnContainer").gameObject
  60. if tolua.getpeer(tmp) == nil then
  61. tolua.setpeer(tmp, {})
  62. end
  63. self.btnContainer = tmp
  64. tmp.rectTransform = tmp:GetComponent(Enum.TypeInfo.RectTransform)
  65. tmp.verticalLayoutGroup = tmp:GetComponent(Enum.TypeInfo.VerticalLayoutGroup)
  66. tmp.contentSizeFitter = tmp:GetComponent(Enum.TypeInfo.ContentSizeFitter)
  67. end
  68. ---@private
  69. function UIFuncMenuView:InitGenerate__3(Root, data)
  70. --[[
  71. BtnContainer/Btn
  72. --]]
  73. local tmp = Root:Find("BtnContainer/Btn").gameObject
  74. if tolua.getpeer(tmp) == nil then
  75. tolua.setpeer(tmp, {})
  76. end
  77. self.btn = tmp
  78. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  79. end
  80. ---@private
  81. function UIFuncMenuView:InitGenerate__4(Root, data)
  82. --[[
  83. BtnContainer/Btn/Text
  84. --]]
  85. local tmp = Root:Find("BtnContainer/Btn/Text").gameObject
  86. if tolua.getpeer(tmp) == nil then
  87. tolua.setpeer(tmp, {})
  88. end
  89. self.btn.text = tmp
  90. tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
  91. end
  92. ---@private
  93. function UIFuncMenuView:GenerateDestroy()
  94. if tolua.getpeer(self.btn.text) ~= nil then
  95. tolua.setpeer(self.btn.text, nil)
  96. end
  97. if tolua.getpeer(self.mask) ~= nil then
  98. tolua.setpeer(self.mask, nil)
  99. end
  100. self.mask = nil
  101. if tolua.getpeer(self.btnContainer) ~= nil then
  102. tolua.setpeer(self.btnContainer, nil)
  103. end
  104. self.btnContainer = nil
  105. if tolua.getpeer(self.btn) ~= nil then
  106. tolua.setpeer(self.btn, nil)
  107. end
  108. self.btn = nil
  109. self.transform = nil
  110. self.gameObject = nil
  111. self.inited = false
  112. end
  113. return UIFuncMenuView