Ejemplo n.º 1
0
 public void SendMsg(MsgBase msg)
 {
     if (msg.GetManager() == curManId)
     {
         ProcessEvent(msg);
     }
     else
     {
         MsgCenter.Instance.SendToMsg(msg);
     }
 }
Ejemplo n.º 2
0
        private void AnasysisMsg(MsgBase tmpMsg)
        {
            ManagerID tmpId = tmpMsg.GetManager();

            switch (tmpId)
            {
            case ManagerID.UIManager:
                UIManager.Instance.SendMsg(tmpMsg);
                //GameManager.Instance.SendMssg(tmpMsg);
                break;
            }
        }
Ejemplo n.º 3
0
 public override void ProcessEvent(MsgBase tmpMsg)
 {
     if (!nodeTree.ContainsKey(tmpMsg.msgId))
     {
         Debug.LogError("msg  不包含该 id:" + tmpMsg.msgId);
         Debug.LogError("msg 模块 为 s:" + tmpMsg.GetManager());
         return;
     }
     else
     {
         EventNode tmpNoe = nodeTree[tmpMsg.msgId];
         while (tmpNoe != null)
         {
             if (tmpNoe.data.isActiveAndEnabled)
             {
                 tmpNoe.data.ProcessEvent(tmpMsg);
             }
             tmpNoe = tmpNoe.next;
         }
     }
 }