Example #1
0
    //checks for input for pausing the game
    public void CheckInput()
    {
        if (ReInput.players.playerCount >= 0)
        {
            IList <Player> players = ReInput.players.Players;
            for (int i = 0; i < players.Count; i++)
            {
                if (players[i].GetButtonDown("Menu") && !paused)        //add b button to exit
                {
                    SelectedButton(resumeButton);

                    ActivatePauseMenu(true);
                    //SetTimeScale(0f);
                    paused = true;
                }
                else if (players[i].GetButtonDown("Menu") && paused && !settings)
                {
                    //SetTimeScale(1f);
                    ActivatePauseMenu(false);
                    paused = false;
                }
                else if (players[i].GetButtonDown("Menu") && paused && settings)
                {
                    settingsScript.ActivateSettings(false);
                    settings = false;
                }
            }
        }
    }