void OpenOrCloseInv()
        {
            if (invControl != null && invControl.Disposed)
            {
                invControl = null;
            }

            if (invControl == null)
            {
                // If any UIWindow is opened, then can't open MenuWindow.
                if (ParentRoot.GetComponent <UIWindow>(true, true) == null)
                {
                    invControl = ResourceManager.LoadSeparateInstance <UIControl>(@"Store\AndreyKorolev\Inventory\File.ui", false, true);
                    if (invControl != null)
                    {
                        invOpen = true;
                        AddComponent(invControl);
                    }
                }
            }
            else
            {
                invControl.Dispose();
                invControl = null;
                invOpen    = false;
            }
        }
Example #2
0
        void OpenOrCloseMenu()
        {
            if (menuWindow != null && menuWindow.Disposed)
            {
                menuWindow = null;
            }

            if (menuWindow == null)
            {
                // If any UIWindow is opened, then can't open MenuWindow.
                if (ParentRoot.GetComponent <UIWindow>(true, true) == null)
                {
                    menuWindow = ResourceManager.LoadSeparateInstance <UIWindow>(@"Base\UI\Screens\MenuWindow.ui", false, true);
                    if (menuWindow != null)
                    {
                        AddComponent(menuWindow);
                    }
                }
            }
            else
            {
                menuWindow.Dispose();
                menuWindow = null;
            }
        }
        public void OpenOrCloseLevelWindow()
        {
            if (menuWindow != null && menuWindow.Disposed)
            {
                menuWindow = null;
            }

            if (menuWindow == null)
            {
                // If any UIWindow is opened, then can't open MenuWindow.
                if (ParentRoot.GetComponent <UIWindow>(true, true) == null)
                {
                    ScreenMessages.Add("1");
                    menuWindow = ResourceManager.LoadSeparateInstance <UIWindow>(@"Store\AndreyKorolev\5MinGame\NextLevelMenu.ui", false, true);
                    if (menuWindow != null)
                    {
                        AddComponent(menuWindow);
                    }
                }
            }
            else
            {
                ScreenMessages.Add("2");
                menuWindow.Dispose();
                menuWindow = null;
            }
        }