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; } }
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; } }
async void BroadcastMsgDealyAsync(Action <MsgBase> action, MsgBase msg, float delayTime) { await Task.Delay((int)delayTime * 1000); action?.Invoke(msg); }
public void BroadcastMsgDealy(MsgBase msg, float delayTime) { BroadcastMsgDealyAsync(BroadcastMsg, msg, delayTime); }
/// <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; }