示例#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);
 }
 public DelayAction(Action <MsgBase> action, float delay, MsgBase msg)
 {
     m_Callback = action;
     m_Delay    = delay;
     m_Msg      = msg;
 }