/// <summary> /// 关闭一个类型的UI /// </summary> public void CloseAllType(BaseUI.UiType type, bool useAnim = true) { if (type == BaseUI.UiType.PANEL_STACK) { CloseUIStack(); } foreach (KeyValuePair <object, BaseUI> obj in _dictionary) { if (obj.Value.uiType == type) { CloseUI(obj.Key, useAnim); } } }
/// <summary> /// 注册UI /// </summary> /// <param name="uiId"></param> /// <param name="ui"></param> public void RegisterUI(object uiId, BaseUI ui, BaseUI.UiType type)//,BaseUI.Type type) { if (_dictionary.ContainsKey(uiId)) { Debug.Log(uiId + " 已有相同ID注册"); return; } else { _dictionary.Add(uiId, ui); } ui.uiID = uiId; ui.uiType = type; ui.OnRegister(); ui.gameObject.SetActive(false); }