//入栈,显示界面 public void PushUIPanel(string UIName) { if (UIStack.Count > 0) { UIBase old_topUI = UIStack.Peek(); old_topUI.DoOnPausing(); } UIBase new_topUI = GetUIBase(UIName); new_topUI.DoOnEntering(); UIStack.Push(new_topUI); }
/// <summary> /// 入栈 /// </summary> public UIBase PushUIPanel(string UIname) { if (UIStack.Count > 0) { UIBase old_topUI = UIStack.Peek(); old_topUI.DoOnPausing(); } UIBase new_topUI = GetUIBase(UIname); new_topUI.DoOnEntering(); UIStack.Push(new_topUI); foreach (string ui in currentUIDic.Keys) { if (ui == UIname) { return(new_topUI); } } new_topUI.UILayer = currentUIDic.Count; currentUIDic.Add(UIname, new_topUI); new_topUI.transform.SetSiblingIndex(new_topUI.UILayer); return(new_topUI); }