PetRuneItem_Generate.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ---@class PetRuneItem__Generate_lv
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public text TMPro.TextMeshProUGUI
  4. ---@class PetRuneItem__Generate_slot
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public image UnityEngine.UI.Image
  7. ---@class PetRuneItem__Generate_frame
  8. ---@field public gameObject UnityEngine.GameObject
  9. ---@field public image UnityEngine.UI.Image
  10. ---@class PetRuneItem__Generate_icon
  11. ---@field public gameObject UnityEngine.GameObject
  12. ---@field public image UnityEngine.UI.Image
  13. ---@class PetRuneItem__Generate_bg
  14. ---@field public gameObject UnityEngine.GameObject
  15. ---@field public image UnityEngine.UI.Image
  16. ---@field public button UnityEngine.UI.Button
  17. ---@class PetRuneItem__Generate
  18. ---@field private gameObject UnityEngine.GameObject
  19. ---@field private transform UnityEngine.Transform
  20. ---@field private bg PetRuneItem__Generate_bg
  21. ---@field private icon PetRuneItem__Generate_icon
  22. ---@field private frame PetRuneItem__Generate_frame
  23. ---@field private slot PetRuneItem__Generate_slot
  24. ---@field private lv PetRuneItem__Generate_lv
  25. local PetRuneItemView = class("PetRuneItemView")
  26. function PetRuneItemView:ctor()
  27. end
  28. ---@private
  29. function PetRuneItemView:SetActive(result)
  30. self.gameObject:SetActive(result)
  31. end
  32. ---@private
  33. function PetRuneItemView:InitGenerate(Root, data)
  34. self.transform = Root
  35. self.inited = true
  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. self:InitGenerate__5(Root,data)
  42. self:InitGenerate__6(Root,data)
  43. end
  44. ---@private
  45. function PetRuneItemView:InitGenerate__1(Root, data)
  46. --[[
  47. Root
  48. --]]
  49. end
  50. ---@private
  51. function PetRuneItemView:InitGenerate__2(Root, data)
  52. --[[
  53. Bg
  54. --]]
  55. local tmp = Root:Find("Bg").gameObject
  56. if tolua.getpeer(tmp) == nil then
  57. tolua.setpeer(tmp, {})
  58. end
  59. self.bg = tmp
  60. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  61. tmp.button = tmp:GetComponent(Enum.TypeInfo.Button)
  62. end
  63. ---@private
  64. function PetRuneItemView:InitGenerate__3(Root, data)
  65. --[[
  66. Icon
  67. --]]
  68. local tmp = Root:Find("Icon").gameObject
  69. if tolua.getpeer(tmp) == nil then
  70. tolua.setpeer(tmp, {})
  71. end
  72. self.icon = tmp
  73. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  74. end
  75. ---@private
  76. function PetRuneItemView:InitGenerate__4(Root, data)
  77. --[[
  78. Frame
  79. --]]
  80. local tmp = Root:Find("Frame").gameObject
  81. if tolua.getpeer(tmp) == nil then
  82. tolua.setpeer(tmp, {})
  83. end
  84. self.frame = tmp
  85. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  86. end
  87. ---@private
  88. function PetRuneItemView:InitGenerate__5(Root, data)
  89. --[[
  90. Slot
  91. --]]
  92. local tmp = Root:Find("Slot").gameObject
  93. if tolua.getpeer(tmp) == nil then
  94. tolua.setpeer(tmp, {})
  95. end
  96. self.slot = tmp
  97. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  98. end
  99. ---@private
  100. function PetRuneItemView:InitGenerate__6(Root, data)
  101. --[[
  102. Lv
  103. --]]
  104. local tmp = Root:Find("Lv").gameObject
  105. if tolua.getpeer(tmp) == nil then
  106. tolua.setpeer(tmp, {})
  107. end
  108. self.lv = tmp
  109. tmp.text = tmp:GetComponent(Enum.TypeInfo.TextMeshProUGUI)
  110. end
  111. ---@private
  112. function PetRuneItemView:GenerateDestroy()
  113. if tolua.getpeer(self.bg) ~= nil then
  114. tolua.setpeer(self.bg, nil)
  115. end
  116. self.bg = nil
  117. if tolua.getpeer(self.icon) ~= nil then
  118. tolua.setpeer(self.icon, nil)
  119. end
  120. self.icon = nil
  121. if tolua.getpeer(self.frame) ~= nil then
  122. tolua.setpeer(self.frame, nil)
  123. end
  124. self.frame = nil
  125. if tolua.getpeer(self.slot) ~= nil then
  126. tolua.setpeer(self.slot, nil)
  127. end
  128. self.slot = nil
  129. if tolua.getpeer(self.lv) ~= nil then
  130. tolua.setpeer(self.lv, nil)
  131. end
  132. self.lv = nil
  133. self.transform = nil
  134. self.gameObject = nil
  135. self.inited = false
  136. end
  137. return PetRuneItemView