EntryUnlockDscItem_Generate.lua 2.1 KB

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