Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
 public void LinkWindowToTaskbar(Window window, TaskbarButton taskbarButton)
 {
     window.Taskbarbutton = taskbarButton;
     taskbarButton.Window = window;
 }