예제 #1
0
        public void ProcessEvent(MsgBase msg)
        {
            switch (msg.Id)
            {
            case (ushort)SphereItemtMsg.SphereGameStart:
            {
                UIManager.Instance.PopPanel();
                SceneManager.Instance.spereCtrl.Init();
            }
            break;

            case (ushort)SphereItemtMsg.SphereGameSuccess:
            {
                //退出游戏,打开成功UI,切换流程,人物移动
                SceneManager.Instance.spereCtrl.Quit();
                UIManager.Instance.PushPanel(PanelType.SpehreSuccessUI);
            }
            break;
            }
        }
예제 #2
0
        public void ProcessEvent(MsgBase msg)
        {
            switch (msg.Id)
            {
            case (ushort)UIEventMsg.ChoiceUI:
            {
                Debug.Log("播放确认音效");
                UIManager.Instance.PopPanel();
                UIManager.Instance.PushPanel(PanelType.TipsUI);
            }
            break;

            case (ushort)UIEventMsg.Confirm:
            {
                ProcedureManager.Instance.ChangeProcedure(ProcedureType.SphereGame);
                PlayerController.Instance.Move();
            }
            break;
            }
        }
예제 #3
0
        async void BroadcastMsgDealyAsync(Action <MsgBase> action, MsgBase msg, float delayTime)
        {
            await Task.Delay((int)delayTime * 1000);

            action?.Invoke(msg);
        }
예제 #4
0
 public void BroadcastMsgDealy(MsgBase msg, float delayTime)
 {
     BroadcastMsgDealyAsync(BroadcastMsg, msg, delayTime);
 }
예제 #5
0
 /// <summary>
 /// 广播消息
 /// </summary>
 /// <param name="msg"></param>
 public void BroadcastMsg(MsgBase msg)
 {
     ProcessEvent(msg);
 }
예제 #6
0
 public DelayAction(Action <MsgBase> action, float delay, MsgBase msg)
 {
     m_Callback = action;
     m_Delay    = delay;
     m_Msg      = msg;
 }