public void RemoveWindow(UIBaseWindow window) { if (!window) { return; } if (windows.ContainsKey(window.Id)) { windows.Remove(window.Id); OnWindowRemoved?.Invoke(window.Id); Destroy(window.gameObject); } }
public void AddWindow(UIBaseWindow window) { if (!window) { return; } if (!windows.ContainsKey(window.Id)) { var clone = Instantiate(window, windowsRoot); windows[window.Id] = clone; OnWindowAdded?.Invoke(clone); clone.Init(); } }