using ET; using System.Collections.Generic; namespace ET { /// /// UI栈 /// public class FUIStackComponent: Entity { private readonly Stack uis = new Stack(); public int Count { get { return uis.Count; } } public void Push(FUI fui) { if (this.uis.Count >= 1) uis.Peek().Visible = false; uis.Push(fui); } public void Pop() { FUI fui = uis.Pop(); fui.Dispose(); if (uis.Count > 0) { uis.Peek().Visible = true; } } public void Clear() { while (uis.Count > 0) { FUI fui = uis.Pop(); fui.Dispose(); } } } }