public void PopPanel(BaseUI panelType) { if (panelList == null || panelList.Count <= 0) { return; } panelType.OnExit(); panelList.Remove(panelType); }
public void PopPanel(UIPanelType panelType, bool isDestory = false) { if (panelList == null || panelList.Count <= 0) { return; } BaseUI topPanel = panelDict[panelType]; topPanel.OnExit(); panelList.Remove(topPanel); if (isDestory) { GameObject.Destroy(topPanel.gameObject); panelDict.Remove(panelType); } }
public BaseUI PushPanel(UIPanelType panelType, bool isExit = false) { BaseUI topPanel = null; if (panelList.Count > 0 && isExit) { topPanel = panelList[panelList.Count - 1]; topPanel.OnExit(); } BaseUI panel = GetPanel(panelType); if (!panelList.Contains(panel)) { panelList.Add(panel); panel.OnEnter(); } return(panel); }