public IUIBaseCtrl ShowPanel(string panelStr, bool modal = true) { string nname = panelStr; IUIBaseCtrl UICtrl = null; if (mUIPanelMap.ContainsKey(panelStr)) { UICtrl = mUIPanelMap[panelStr]; //更换顺序 mUILayerList.Remove(UICtrl); mUILayerList.Add(UICtrl); } else { Type type = mUITypeMap[nname]; UICtrl = (IUIBaseCtrl)Activator.CreateInstance(type); if (UICtrl != null) { UICtrl.Setup(panelStr, this); mUIPanelMap[nname] = UICtrl; mUILayerList.Add(UICtrl); } } AdjustLayerOrder(modal); return(UICtrl); }
public void CloseCertainPanel(IUIBaseCtrl toClose) { string name = toClose.nameStr; if (mUIPanelMap.ContainsKey(name)) { mUILayerList.Remove(toClose); mUIPanelMap.Remove(name); toClose.Release(); } else { if (mUILayerList.Contains(toClose)) { toClose.Release(); mUILayerList.Remove(toClose); } else { Debug.Log("close not exitst ui panel"); } } AdjustLayerOrder(); CloseLastMask(); }
public void CloseLastMask() { if (mUILayerList.Count == 0) { return; } IUIBaseCtrl ctrl = mUILayerList[mUILayerList.Count - 1]; ctrl.CloseLastMask(); }
public void CloseFirstPanel() { if (mUILayerList.Count == 0) { return; } IUIBaseCtrl ctrl = mUILayerList[mUILayerList.Count - 1]; ctrl.Release(); mUILayerList.RemoveAt(mUILayerList.Count - 1); mUIPanelMap.Remove(ctrl.nameStr); AdjustLayerOrder(); }