private void AnasysisMsg(MsgBase tmpMsg) { ManagerID tmpId = tmpMsg.getManager(); switch (tmpId) { case ManagerID.AssetManager: AssetManager.Instance.ProcessEvent(tmpMsg); break; case ManagerID.AudioManager: break; case ManagerID.CharactorManager: break; case ManagerID.GameManager: break; case ManagerID.NetManager: break; case ManagerID.NPCManager: break; case ManagerID.UIManager: UIManager.Instance.ProcessEvent(tmpMsg); break; default: break; } }
public void SendMsg(MsgBase msg) { //本模块处理 if (msg.getManager() == ManagerID.NPCManager) { ProcessEvent(msg); } else //交给消息中心 { MsgCenter.Instance.SendToMsg(msg); } }
//来了消息处理消息 public override void ProcessEvent(MsgBase tmpMsg) { if (!m_eventTree.ContainsKey(tmpMsg.m_msgId)) { Debug.LogError("msg " + tmpMsg.m_msgId + " not contail "); Debug.LogError("msg Manager " + tmpMsg.getManager()); } else { EventNode tmp = m_eventTree[tmpMsg.m_msgId]; do { tmp.m_data.ProcessEvent(tmpMsg); tmp = tmp.m_next; } while (tmp != null); } }