InfoDscItem_Generate.lua 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. ---@class InfoDscItem__Generate_textDsc
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public text UnityEngine.UI.Text
  4. ---@class InfoDscItem__Generate_icon
  5. ---@field public gameObject UnityEngine.GameObject
  6. ---@field public image UnityEngine.UI.Image
  7. ---@class InfoDscItem__Generate_textName
  8. ---@field public gameObject UnityEngine.GameObject
  9. ---@field public text UnityEngine.UI.Text
  10. ---@class InfoDscItem__Generate
  11. ---@field private gameObject UnityEngine.GameObject
  12. ---@field private transform UnityEngine.Transform
  13. ---@field private textName InfoDscItem__Generate_textName
  14. ---@field private icon InfoDscItem__Generate_icon
  15. ---@field private textDsc InfoDscItem__Generate_textDsc
  16. local InfoDscItemView = class("InfoDscItemView")
  17. function InfoDscItemView:ctor()
  18. end
  19. ---@private
  20. function InfoDscItemView:SetActive(result)
  21. self.gameObject:SetActive(result)
  22. end
  23. ---@private
  24. function InfoDscItemView:InitGenerate(Root, data)
  25. self.transform = Root
  26. self.inited = true
  27. local tmp
  28. self:InitGenerate__1(Root,data)
  29. self:InitGenerate__2(Root,data)
  30. self:InitGenerate__3(Root,data)
  31. self:InitGenerate__4(Root,data)
  32. end
  33. ---@private
  34. function InfoDscItemView:InitGenerate__1(Root, data)
  35. --[[
  36. Root
  37. --]]
  38. end
  39. ---@private
  40. function InfoDscItemView:InitGenerate__2(Root, data)
  41. --[[
  42. Layout/NameBg/TextName
  43. --]]
  44. local tmp = Root:Find("Layout/NameBg/TextName").gameObject
  45. if tolua.getpeer(tmp) == nil then
  46. tolua.setpeer(tmp, {})
  47. end
  48. self.textName = tmp
  49. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  50. end
  51. ---@private
  52. function InfoDscItemView:InitGenerate__3(Root, data)
  53. --[[
  54. Layout/Content/Icon
  55. --]]
  56. local tmp = Root:Find("Layout/Content/Icon").gameObject
  57. if tolua.getpeer(tmp) == nil then
  58. tolua.setpeer(tmp, {})
  59. end
  60. self.icon = tmp
  61. tmp.image = tmp:GetComponent(Enum.TypeInfo.Image)
  62. end
  63. ---@private
  64. function InfoDscItemView:InitGenerate__4(Root, data)
  65. --[[
  66. Layout/Content/TextDsc
  67. --]]
  68. local tmp = Root:Find("Layout/Content/TextDsc").gameObject
  69. if tolua.getpeer(tmp) == nil then
  70. tolua.setpeer(tmp, {})
  71. end
  72. self.textDsc = tmp
  73. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  74. end
  75. ---@private
  76. function InfoDscItemView:GenerateDestroy()
  77. if tolua.getpeer(self.textDsc) ~= nil then
  78. tolua.setpeer(self.textDsc, nil)
  79. end
  80. if tolua.getpeer(self.icon) ~= nil then
  81. tolua.setpeer(self.icon, nil)
  82. end
  83. if tolua.getpeer(self.textName) ~= nil then
  84. tolua.setpeer(self.textName, nil)
  85. end
  86. self.transform = nil
  87. self.gameObject = nil
  88. self.inited = false
  89. end
  90. return InfoDscItemView