public void UnRegisterUIMessage(string name, UIMEssageType type, UIPage page) { Dictionary <string, List <UIPage> > container = null; if (type == UIMEssageType.PushScene) { container = pushSceneMessage; } else if (type == UIMEssageType.PopScene) { container = popSceneMessage; } else if (type == UIMEssageType.PushPage) { container = pushPageMessage; } else if (type == UIMEssageType.PopPage) { container = popPageMessage; } if (container.ContainsKey(name) == false) { UnityEngine.Debug.LogError("the " + type.ToString() + " don;t have " + name + "registered"); return; } List <UIPage> list = container[name]; bool haveThePage = false; for (int i = 0; i < list.Count; i++) { if (list[i] == page) { list.RemoveAt(i); haveThePage = true; break; } } if (haveThePage == false) { UnityEngine.Debug.LogError(page.GetPageName() + " don't registered " + type.ToString() + " " + name); } }
public void RegisterUIMessage(string name, UIMEssageType type, UIPage page) { Dictionary <string, List <UIPage> > container = null; if (type == UIMEssageType.PushScene) { container = pushSceneMessage; } else if (type == UIMEssageType.PopScene) { container = popSceneMessage; } else if (type == UIMEssageType.PushPage) { container = pushPageMessage; } else if (type == UIMEssageType.PopPage) { container = popPageMessage; } if (container.ContainsKey(name)) { List <UIPage> list = container[name]; bool haveThePage = false; for (int i = 0; i < list.Count; i++) { if (list[i] == page) { haveThePage = true; break; } } if (haveThePage) { UnityEngine.Debug.LogError("please do not register " + name + " " + type.ToString() + " again"); return; } list.Add(page); } else { List <UIPage> list = new List <UIPage>(); list.Add(page); container.Add(name, list); } }
public override void OnUIMessage(UIMEssageType type, string name) { UnityEngine.Debug.LogError("Message type is " + type.ToString() + " " + name); }