/// <summary> /// 本地信箱的消息筛选阅读方法 /// </summary> /// <param name="messageAddress">消息标志,消息处理中心的键值对</param> private void ReadLocalMessage(MessageAddress messageAddress) { //Debug.Log("正在本地信箱筛选消息"); //MessageCenter.Message message; foreach (KeyValuePair <LocalMessageAddress, MessageCenter.Message> kv in LocalMessageBox) { if (kv.Key.ChildAddress == messageAddress.Address && kv.Key.FuncName == messageAddress.FuncName) { //Debug.Log("找到本地消息体"); kv.Value(messageAddress); return; } } }
public static void GetMessage(string panelName, MessageAddress messageAddress) { Message message; if (messageAddress.Address == null) { messageAddress.Address = panelName; } if (messageBox.TryGetValue(panelName, out message)) { if (message != null) { //Debug.Log("现在去筛选阅读" + panelName + "的本地消息"); message(messageAddress); } } }
private void PanelActive(MessageAddress messageAddress) { OnActive(); }
public static void ClosePanel(string panelName) { MessageAddress ma = new MessageAddress("PanelInActive", null, panelName); GetMessage(panelName, ma); }