/// <summary> /// 显示UI /// </summary> /// <param name="uiPanel"></param> public void Show(UIPanel uiPanel) { if (currentShow != null) { currentShow.OnExit(); } currentShow = uiBase[uiPanel]; currentShow.DoScreen(); }
/* * 层级管理,弹出UI * **/ public void PopPanel(BaseUIPanel panel) { if (panelList.Count <= 0) { return; } //从列表中删除面板 if (panelList.Contains(panel)) { //判断是否有绑定子UI if (bindDic.ContainsKey(panel)) { foreach (BaseUIPanel bp in bindDic[panel]) { if (panelList.Contains(bp)) { panelList.Remove(bp); bp.OnExit(); } } } panelList.Remove(panel); panel.OnExit(); } else { return; } //恢复上一个面板 if (panelList.Count > 0) { panel = panelList[panelList.Count - 1]; panel.OnResume(); //Debug.Log(panel.name); } OnChangeTier.Invoke(); }