public void PushPanel(UIPanelType panelType) { if (panelStack == null) { panelStack = new Stack <BasePanel>(); } if (panelStack.Count > 0) { BasePanel topPanel = panelStack.Peek(); topPanel.OnPause(); } BasePanel panel = GetPanel(panelType); panel.OnEnter(); panelStack.Push(panel); }
public void PopPanel() { if (panelStack == null) { panelStack = new Stack <BasePanel>(); } if (panelStack.Count == 0) { return; } BasePanel topPanel01 = panelStack.Pop(); topPanel01.OnExit(); if (panelStack.Count == 0) { return; } BasePanel topPanel02 = panelStack.Peek(); topPanel02.OnContinue(); }