BattleReplayControlPart.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. local BattleReplayControlPart = class("BattleReplayControlPart")
  2. function BattleReplayControlPart:ctor()
  3. end
  4. function BattleReplayControlPart:InitGo(host,uiGo)
  5. self.host = host
  6. self.viewLua = CommonUtil.BindGridViewItem2Lua(self.host, "BattleReplayControl", uiGo)
  7. end
  8. function BattleReplayControlPart:AddUIEventListener()
  9. self.host.uiBase:AddButtonEventListener(self.viewLua.exitBtn.button,self, self.OnClickExitBtn)
  10. end
  11. function BattleReplayControlPart:SetCanvasOrder(order)
  12. self.viewLua.canvas.sortingOrder = order
  13. end
  14. function BattleReplayControlPart:Show(levelName)
  15. local battleTime,fightPower = ManagerContainer.LuaBattleMgr:GetCacheRecordInfo()
  16. self.viewLua.levelName.text.text = levelName
  17. self.viewLua.passLevelTime.text.text = tostring(battleTime) .. "s"
  18. self.viewLua.fightPower.text.text = tostring(fightPower)
  19. self.viewLua:SetActive(true)
  20. end
  21. function BattleReplayControlPart:Hide()
  22. self.viewLua:SetActive(false)
  23. end
  24. function BattleReplayControlPart:Dispose()
  25. end
  26. function BattleReplayControlPart:OnClickExitBtn()
  27. LuaBattleBridge.SkipReplay()
  28. end
  29. return BattleReplayControlPart