/// <summary> /// 用于一个mono注册多个消息 /// </summary> /// <param name="mono"></param> /// <param name="msgIds"></param> public void RegistMsg(MonoBase mono, params int[] msgIds) { for (int i = 0; i < msgIds.Length; i++) { MessageNode tmp = new MessageNode(mono); RegistMsg(msgIds[i], tmp); } }
/// <summary> /// 用于某个消息注册一个mono(Node) /// </summary> /// <param name="msgId"></param> /// <param name="node"></param> public void RegistMsg(int msgId, MessageNode node) { if (!m_eventTree.ContainsKey(msgId)) { List <MessageNode> list = new List <MessageNode>(); list.Add(node); m_eventTree.Add(msgId, list); } else { List <MessageNode> list = new List <MessageNode>(); m_eventTree.TryGetValue(msgId, out list); list.Add(node); } }