// Update is called once per frame
        void Update()
        {
            if (mainMenuWindow.enabled == false && settingsMenuWindow.enabled == false)
            {
                return;
            }

            if (InputManager.MyInstance.KeyBindWasPressed("CANCEL"))
            {
                settingsMenuWindow.CloseWindow();
                creditsWindow.CloseWindow();
                exitMenuWindow.CloseWindow();
                playMenuWindow.CloseWindow();
                deleteGameMenuWindow.CloseWindow();
                copyGameMenuWindow.CloseWindow();
                confirmDestroyMenuWindow.CloseWindow();
                confirmSellItemMenuWindow.CloseWindow();
                inGameMainMenuWindow.CloseWindow();

                // testing - do not allow accidentally closing this while dead
                if (PlayerManager.MyInstance.MyPlayerUnitSpawned == true && PlayerManager.MyInstance.MyCharacter.CharacterStats.IsAlive != false)
                {
                    playerOptionsMenuWindow.CloseWindow();
                }
            }

            if (InputManager.MyInstance.KeyBindWasPressed("MAINMENU"))
            {
                inGameMainMenuWindow.ToggleOpenClose();
            }
        }
Пример #2
0
        // Update is called once per frame
        void Update()
        {
            if (mainMenuWindow.enabled == false && settingsMenuWindow.enabled == false)
            {
                return;
            }

            if (InputManager.MyInstance.KeyBindWasPressed("CANCEL"))
            {
                settingsMenuWindow.CloseWindow();
                creditsWindow.CloseWindow();
                exitMenuWindow.CloseWindow();
                playMenuWindow.CloseWindow();
                deleteGameMenuWindow.CloseWindow();
                copyGameMenuWindow.CloseWindow();
                confirmDestroyMenuWindow.CloseWindow();
                confirmSellItemMenuWindow.CloseWindow();
            }

            if (InputManager.MyInstance.KeyBindWasPressed("MAINMENU"))
            {
                inGameMainMenuWindow.ToggleOpenClose();
            }

            if (InputManager.MyInstance.KeyBindWasPressed("CANCEL"))
            {
                inGameMainMenuWindow.CloseWindow();
                playerOptionsMenuWindow.CloseWindow();
            }
        }
        // Update is called once per frame
        void Update()
        {
            if (PlayerManager.MyInstance.MyPlayerUnitSpawned == false)
            {
                // if there is no player, these windows shouldn't be open
                return;
            }
            // don't open windows while binding keys
            if (KeyBindManager.MyInstance.MyBindName == string.Empty)
            {
                if (InputManager.MyInstance.KeyBindWasPressed("INVENTORY"))
                {
                    InventoryManager.MyInstance.OpenClose();
                }
                if (InputManager.MyInstance.KeyBindWasPressed("ABILITYBOOK"))
                {
                    abilityBookWindow.ToggleOpenClose();
                }
                if (InputManager.MyInstance.KeyBindWasPressed("SKILLBOOK"))
                {
                    skillBookWindow.ToggleOpenClose();
                }
                if (InputManager.MyInstance.KeyBindWasPressed("ACHIEVEMENTBOOK"))
                {
                    achievementListWindow.ToggleOpenClose();
                }
                if (InputManager.MyInstance.KeyBindWasPressed("REPUTATIONBOOK"))
                {
                    reputationBookWindow.ToggleOpenClose();
                }
                if (InputManager.MyInstance.KeyBindWasPressed("CURRENCYLIST"))
                {
                    currencyListWindow.ToggleOpenClose();
                }
                if (InputManager.MyInstance.KeyBindWasPressed("CHARACTERPANEL"))
                {
                    characterPanelWindow.ToggleOpenClose();
                }
                if (InputManager.MyInstance.KeyBindWasPressed("QUESTLOG"))
                {
                    questLogWindow.ToggleOpenClose();
                }
                if (InputManager.MyInstance.KeyBindWasPressed("MAINMAP"))
                {
                    //Debug.Log("mainmap was pressed");
                    mainMapWindow.ToggleOpenClose();
                }
            }

            if (InputManager.MyInstance.KeyBindWasPressed("CANCEL"))
            {
                CloseAllWindows();
            }
        }