예제 #1
0
        public void RemoveWindow(UIBaseWindow window)
        {
            if (!window)
            {
                return;
            }

            if (windows.ContainsKey(window.Id))
            {
                windows.Remove(window.Id);
                OnWindowRemoved?.Invoke(window.Id);
                Destroy(window.gameObject);
            }
        }
예제 #2
0
        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();
            }
        }