예제 #1
0
        void Update()
        {
            foreach (Window window in GetComponentsInChildren <Window>())
            {
                if (window.gameObject.activeInHierarchy && !window.Taskbarbutton)
                {
                    Debug.Log("Linking button!");

                    TaskbarButton button = CreateTaskbarButton();
                    LinkWindowToTaskbar(window, button);
                }
            }
        }
예제 #2
0
        public Window CreateWindow(GameObject prefab)
        {
            GameObject windowObject = Instantiate(prefab, Screen.transform, false);

            Window        window        = windowObject.GetComponent <Window>();
            TaskbarButton taskbarButton = Taskbar.AddButton();

            if (window && taskbarButton)
            {
                LinkWindowToTaskbar(window, taskbarButton);
                return(window);
            }

            Destroy(windowObject);
            Taskbar.RemoveButton(taskbarButton);
            return(null);
        }
예제 #3
0
 public void LinkWindowToTaskbar(Window window, TaskbarButton taskbarButton)
 {
     window.Taskbarbutton = taskbarButton;
     taskbarButton.Window = window;
 }