UIDojoExitView.lua 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. local UIDojoExitView = require("UIDojo/UIDojoExitView_Generate")
  2. function UIDojoExitView:OnAwake(data)
  3. self.controller = require("UIDojo/UIDojoExitCtr"):new()
  4. self.controller:Init(self)
  5. self.controller:SetData(data)
  6. end
  7. function UIDojoExitView:AddEventListener()
  8. end
  9. function UIDojoExitView:FillContent(data, uiBase)
  10. self.uiBase = uiBase
  11. local gameObject = self.uiBase:GetRoot()
  12. if gameObject ~= nil then
  13. self.gameObject = gameObject
  14. self.transform = gameObject.transform
  15. end
  16. self:InitGenerate(self.transform, data)
  17. self:Init()
  18. end
  19. function UIDojoExitView:Init()
  20. if self.controller:GetData() ~= true then --是否播放录像退出
  21. ManagerContainer.LuaDojoMgr:CloseBattlePage();
  22. end
  23. local _second = GlobalConfig.Instance:GetConfigIntValue(166);
  24. LuaBattleBridge.PlayTweenAlpha(self.centerView, 0, _second);
  25. self._timer = ManagerContainer.LuaTimerMgr:AddTimer(_second * 1000, 1, self, self.DownAlpha, nil)
  26. end
  27. function UIDojoExitView:DownAlpha()
  28. if self.controller:GetData() ~= true then --是否播放录像退出
  29. ManagerContainer.LuaDojoMgr:BackDojoMain();
  30. else
  31. ManagerContainer.LuaUIMgr:ClosePage(Enum.UIPageName.UIDojoExit)
  32. end
  33. end
  34. function UIDojoExitView:RemoveEventListener()
  35. ManagerContainer.LuaEventMgr:Unregister(self.uiData.name)
  36. end
  37. function UIDojoExitView:AddUIEventListener()
  38. ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name)
  39. end
  40. function UIDojoExitView:OnHide()
  41. end
  42. function UIDojoExitView:OnShow(data)
  43. self.controller:SetData(data)
  44. self:Init()
  45. end
  46. function UIDojoExitView:OnClose()
  47. end
  48. function UIDojoExitView:OnDispose()
  49. if self._timer ~= nil then
  50. ManagerContainer.LuaTimerMgr:RemoveTimer(self._timer)
  51. self._timer = nil
  52. end
  53. end
  54. return UIDojoExitView