KLMapTransferAnimPanelPanel.lua 926 B

123456789101112131415161718192021222324252627282930313233343536
  1. ---@class KLMapTransferAnimPanelPanel:UIKmlLuaPanelBase
  2. ---@field view KLMapTransferAnimPanelPanelView
  3. local KLMapTransferAnimPanelPanel = class(UIKmlLuaPanelBase)
  4. local this =KLMapTransferAnimPanelPanel
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---注册UI事件和服务器消息
  9. function this:RegistEvents()
  10. end
  11. ---创建或者刷新界面数据时调用
  12. function this:Refresh()
  13. self.anim = Coroutine.Start(self.PlayAnim,self)
  14. end
  15. function this:PlayAnim()
  16. SL.HideMainPanel()
  17. local curFillAmount = 0
  18. while(curFillAmount < 1) do
  19. GUI:Image_setFillAmount(self.view.img_trans_anim, curFillAmount)
  20. curFillAmount = curFillAmount + Time.deltaTime
  21. Coroutine.WaitForEndOfFrame()
  22. end
  23. GUI:UIPanel_Close("dev/ui/Map/Panel/KLMapTransferAnimPanel/KLMapTransferAnimPanelPanel")
  24. end
  25. function this:Close()
  26. SL.ShowMainPanel()
  27. Coroutine.Stop(self.anim)
  28. end
  29. return this