Beispiel #1
0
        /**
         *
         */
        private void Update()
        {
            var activeSceneName = SceneManager.GetActiveScene().name;

            //exit from application in main menu
            if (activeSceneName.Equals("MainMenuScene") && ControlUtils.BackAction())
            {
                KeyFunctions.ExitOnButton();
                return;
            }

            //return from manual to settings
            if (activeSceneName.Equals("MainSettingsManual") && ControlUtils.BackAction())
            {
                Initiate.Fade("MainSettingsScene", AnimUtils.AnimationColor, AnimUtils.AnimationLength);
                return;
            }

            //return from settings to main menu
            if (activeSceneName.Equals("MainSettingsScene") && ControlUtils.BackAction())
            {
                Initiate.Fade("MainMenuScene", AnimUtils.AnimationColor, AnimUtils.AnimationLength);
                return;
            }

            //return from file picker to main menu
            if (activeSceneName.Equals("MainMenuFilePicker") && ControlUtils.BackAction())
            {
                Initiate.Fade("MainMenuScene", AnimUtils.AnimationColor, AnimUtils.AnimationLength);
                return;
            }

            //return from save file picker to main menu
            if (activeSceneName.Equals("MainMenuLoadFile") && ControlUtils.BackAction())
            {
                Initiate.Fade("MainMenuScene", AnimUtils.AnimationColor, AnimUtils.AnimationLength);
                return;
            }

            //move in menu with keyboard
            if (Input.GetAxisRaw("Vertical") != 0 && ButtonSelected == false)
            {
                EventSystem.SetSelectedGameObject(SelectedObject);
                ButtonSelected = true;
            }
        }
 /**
  * OnClick listener for EXIT button in the Main menu
  */
 public void ExitOnClickKey()
 {
     KeyFunctions.ExitOnButton();
 }