using System.Collections.Generic; namespace ET { public class UIComponentAwakeSystem : AwakeSystem { public override void Awake(UIComponent self) { } } /// /// 管理所有UI /// public class UIComponent: Entity { public Dictionary uis = new Dictionary(); public void Add(UI ui) { this.uis.Add(ui.Name, ui); ui.Parent = this; } public void Remove(string name) { if (!this.uis.TryGetValue(name, out UI ui)) { return; } this.uis.Remove(name); ui.Dispose(); } public UI Get(string name) { UI ui = null; this.uis.TryGetValue(name, out ui); return ui; } } }