CollectionAttrItem_Generate.lua 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ---@class CollectionAttrItem__Generate_numberText
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public text UnityEngine.UI.Text
  4. ---@class CollectionAttrItem__Generate_nameText
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public text UnityEngine.UI.Text
  7. ---@class CollectionAttrItem__Generate
  8. ---@field private gameObject UnityEngine.GameObject
  9. ---@field private transform UnityEngine.Transform
  10. ---@field private nameText CollectionAttrItem__Generate_nameText
  11. ---@field private numberText CollectionAttrItem__Generate_numberText
  12. local CollectionAttrItemView = class("CollectionAttrItemView")
  13. function CollectionAttrItemView:ctor()
  14. end
  15. ---@private
  16. function CollectionAttrItemView:SetActive(result)
  17. self.gameObject:SetActive(result)
  18. end
  19. ---@private
  20. function CollectionAttrItemView:InitGenerate(Root, data)
  21. self.transform = Root
  22. self.inited = true
  23. local tmp
  24. self:InitGenerate__1(Root,data)
  25. self:InitGenerate__2(Root,data)
  26. self:InitGenerate__3(Root,data)
  27. end
  28. ---@private
  29. function CollectionAttrItemView:InitGenerate__1(Root, data)
  30. --[[
  31. Root
  32. --]]
  33. end
  34. ---@private
  35. function CollectionAttrItemView:InitGenerate__2(Root, data)
  36. --[[
  37. NameText
  38. --]]
  39. local tmp = Root:Find("NameText").gameObject
  40. if tolua.getpeer(tmp) == nil then
  41. tolua.setpeer(tmp, {})
  42. end
  43. self.nameText = tmp
  44. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  45. end
  46. ---@private
  47. function CollectionAttrItemView:InitGenerate__3(Root, data)
  48. --[[
  49. NumberText
  50. --]]
  51. local tmp = Root:Find("NumberText").gameObject
  52. if tolua.getpeer(tmp) == nil then
  53. tolua.setpeer(tmp, {})
  54. end
  55. self.numberText = tmp
  56. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  57. end
  58. ---@private
  59. function CollectionAttrItemView:GenerateDestroy()
  60. if tolua.getpeer(self.nameText) ~= nil then
  61. tolua.setpeer(self.nameText, nil)
  62. end
  63. self.nameText = nil
  64. if tolua.getpeer(self.numberText) ~= nil then
  65. tolua.setpeer(self.numberText, nil)
  66. end
  67. self.numberText = nil
  68. self.transform = nil
  69. self.gameObject = nil
  70. self.inited = false
  71. end
  72. return CollectionAttrItemView