IdolSuccessTipsView.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. local IdolSuccessTipsView = require("UISeason/IdolSuccessTipsView_Generate")
  2. local timer = 1.5
  3. function IdolSuccessTipsView:OnAwake(data)
  4. self.controller = require("UISeason/IdolSuccessTipsCtr"):new()
  5. self.controller:Init(self)
  6. self.controller:SetData(data)
  7. end
  8. function IdolSuccessTipsView:AddEventListener()
  9. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name)
  10. end
  11. function IdolSuccessTipsView:FillContent(data, uiBase)
  12. self.uiBase = uiBase
  13. local gameObject = self.uiBase:GetRoot()
  14. if gameObject ~= nil then
  15. self.gameObject = gameObject
  16. self.transform = gameObject.transform
  17. end
  18. self:InitGenerate(self.transform, data)
  19. self:Init()
  20. end
  21. function IdolSuccessTipsView:Init()
  22. if self.updateTimer then
  23. self.updateTimer:Stop()
  24. self.updateTimer = nil
  25. end
  26. if not self.updateTimer then
  27. self.updateTimer = Timer.New(slot(self.UIClose, self), timer, 1)
  28. end
  29. if not self.updateTimer.running then
  30. self.updateTimer:Start()
  31. end
  32. end
  33. function IdolSuccessTipsView:RemoveEventListener()
  34. ManagerContainer.LuaEventMgr:Unregister(self.uiData.name)
  35. end
  36. function IdolSuccessTipsView:AddUIEventListener()
  37. end
  38. function IdolSuccessTipsView:OnShow(data)
  39. self.controller:SetData(data)
  40. end
  41. function IdolSuccessTipsView:OnClose()
  42. end
  43. function IdolSuccessTipsView:OnDispose()
  44. self.controller:OnDispose()
  45. if self.updateTimer then
  46. self.updateTimer:Stop()
  47. self.updateTimer = nil
  48. end
  49. end
  50. return IdolSuccessTipsView