Exemple #1
0
    private void AnalysisMsg(MessageBase tmpMsg)
    {
        ManagerID tempId = tmpMsg.GetManagerId();

        switch (tempId)
        {
        case ManagerID.GameManager:
            break;

        case ManagerID.UIManager:
            break;

        case ManagerID.AudioManager:
            break;

        case ManagerID.NPCManager:
            break;

        case ManagerID.CharacterManager:
            break;

        case ManagerID.AssetManager:
            break;

        case ManagerID.NetManager:
            break;

        default:
            break;
        }
    }
 public void SendMessage(MessageBase msg)
 {
     // ManagerBase 本模块自己处理
     if (msg.GetManagerId() == ManagerID.UIManager)
     {
         ProcessEvent(msg);
     }
     else // 如果不是本模块里的,交给MessageCenter处理
     {
         MessageCenter.Instance.SendToMsg(msg);
     }
 }
Exemple #3
0
    public override void ProcessEvent(MessageBase msg)
    {
        if (!eventTreeDic.ContainsKey(msg.msgId))
        {
            Debug.LogError("字典里没有该信息" + msg);
            Debug.LogError("Msg Manager ==" + msg.GetManagerId());
            return;
        }
        else
        {
            EventNode tempNode = eventTreeDic[msg.msgId];

            do
            {
                // 策略模式
                tempNode.data.ProcessEvent(msg);
            }while (tempNode != null);
        }
    }