Example #1
0
    void Update()
    {
        bool pressed = false;

        switch (this.Input)
        {
        default:
        case ExitInput.Exit:
            pressed = MenuInput.Exit();
            break;

        case ExitInput.Pause:
            pressed = MenuInput.Pause();
            break;

        case ExitInput.Cancel:
            pressed = MenuInput.Cancel();
            break;
        }
        if (pressed)
        {
            if (this.Destination != "")
            {
                ProgressData.LoadFromDisk(true);
                SceneManager.LoadScene(this.Destination);
                Destroy(this.gameObject);
            }
            else
            {
                Application.Quit();
            }
        }
    }
Example #2
0
 void Update()
 {
     if (this.AllowPausing)
     {
         if (MenuInput.Pause())
         {
             if (_paused)
             {
                 unpause();
             }
             else
             {
                 pause();
             }
         }
         else if (MenuInput.Cancel())
         {
             if (_paused)
             {
                 unpause();
             }
         }
     }
 }