FansItem_Generate.lua 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. ---@class FansItem__Generate_text
  2. ---@field public gameObject UnityEngine.GameObject
  3. ---@field public text UnityEngine.UI.Text
  4. ---@class FansItem__Generate
  5. ---@field private gameObject UnityEngine.GameObject
  6. ---@field private transform UnityEngine.Transform
  7. ---@field private text FansItem__Generate_text
  8. local FansItemView = class("FansItemView")
  9. function FansItemView:ctor()
  10. end
  11. ---@private
  12. function FansItemView:SetActive(result)
  13. self.gameObject:SetActive(result)
  14. end
  15. ---@private
  16. function FansItemView:InitGenerate(Root, data)
  17. self.transform = Root
  18. self.inited = true
  19. local tmp
  20. self:InitGenerate__1(Root,data)
  21. self:InitGenerate__2(Root,data)
  22. end
  23. ---@private
  24. function FansItemView:InitGenerate__1(Root, data)
  25. --[[
  26. Root
  27. --]]
  28. end
  29. ---@private
  30. function FansItemView:InitGenerate__2(Root, data)
  31. --[[
  32. text
  33. --]]
  34. local tmp = Root:Find("text").gameObject
  35. if tolua.getpeer(tmp) == nil then
  36. tolua.setpeer(tmp, {})
  37. end
  38. self.text = tmp
  39. tmp.text = tmp:GetComponent(Enum.TypeInfo.Text)
  40. end
  41. ---@private
  42. function FansItemView:GenerateDestroy()
  43. if tolua.getpeer(self.text) ~= nil then
  44. tolua.setpeer(self.text, nil)
  45. end
  46. self.transform = nil
  47. self.gameObject = nil
  48. self.inited = false
  49. end
  50. return FansItemView