private void GoBackVersusMenu()
 {
     Time.timeScale = 1.0f;
     CustomAudio.PlayEffect(MenuBipReturnAudioFileID);
     GenericHelpers.ResetGameInProgress();
     SceneManager.LoadScene("CharSelScene");
 }
Beispiel #2
0
 private void Breakout03()
 {
     GenericHelpers.ResetGameInProgress();
     PlayerPrefs.SetInt("CurrentChallengeDifficulty", 3);
     PlayerPrefs.SetInt("Opponent", Opponent.Breakout.GetHashCode());
     PlayerPrefs.SetInt("GameMode", GameMode.Breakout.GetHashCode());
     PlayerPrefs.SetInt("SelectedMap", 4);
     PlayerPrefs.SetInt("P1Character", 5);
     PlayerPrefs.SetInt("MaxScore", 1);
     LoadGameScene();
 }
Beispiel #3
0
 private void Target02()
 {
     GenericHelpers.ResetGameInProgress();
     PlayerPrefs.SetInt("CurrentChallengeDifficulty", 2);
     PlayerPrefs.SetInt("Opponent", Opponent.Target.GetHashCode());
     PlayerPrefs.SetInt("GameMode", GameMode.Target.GetHashCode());
     PlayerPrefs.SetInt("SelectedMap", 6);
     PlayerPrefs.SetInt("P1Character", 4);
     PlayerPrefs.SetInt("MaxScore", 20);
     LoadGameScene();
 }
Beispiel #4
0
    private void ResetPlayerPrefs()
    {
        GenericHelpers.ResetGameInProgress();

        PlayerPrefs.SetInt("P1Character", 1);
        PlayerPrefs.SetInt("P2Character", 1);
        PlayerPrefs.SetInt("Opponent", Opponent.Player.GetHashCode());
        PlayerPrefs.SetInt("Difficulty", Difficulty.Easy.GetHashCode());
        PlayerPrefs.SetInt("Bounce", Bounce.Normal.GetHashCode());
        PlayerPrefs.SetInt("MaxScore", 12);
        PlayerPrefs.SetInt("MaxSets", 2);
    }
Beispiel #5
0
 private void Tournament04()
 {
     GenericHelpers.ResetGameInProgress();
     PlayerPrefs.SetInt("CurrentChallengeDifficulty", 4);
     PlayerPrefs.SetInt("NbOpponents", 5);
     PlayerPrefs.SetInt("Opponent", Opponent.AI.GetHashCode());
     PlayerPrefs.SetInt("GameMode", GameMode.Tournament.GetHashCode());
     PlayerPrefs.SetInt("TournamentOpponent", 0);
     PlayerPrefs.SetInt("MaxScore", 12);
     PlayerPrefs.SetInt("MaxSets", 2);
     PlayerPrefs.SetString("TournamentDifficulties", "22222");
     SceneManager.LoadScene("CharSelScene");
 }
    private void EndGame()
    {
        UpdateChallengeProgression();

        if (PlayerPrefs.GetInt("GameMode") == GameMode.Tournament.GetHashCode() && _isWinner)
        {
            int nbOpponents        = PlayerPrefs.GetInt("NbOpponents");
            var tournamentOpponent = PlayerPrefs.GetInt("TournamentOpponent", 0);
            tournamentOpponent++;
            if (tournamentOpponent <= nbOpponents)
            {
                GenericHelpers.ResetGameInProgress();
                PlayerPrefs.SetInt("TournamentOpponent", tournamentOpponent);
                SceneManager.LoadScene("TournamentMatch");
                return;
            }
            else if (PlayerPrefs.GetInt("Tournament", 0) <= PlayerPrefs.GetInt("CurrentChallengeDifficulty"))
            {
                PlayerPrefs.SetInt("Tournament", PlayerPrefs.GetInt("CurrentChallengeDifficulty") + 1);
            }
        }

        PlayerPrefs.SetInt("GameInProgress", 0);
        if (PlayerPrefs.GetInt("Ads", 1) == 1)
        {
            SceneManager.LoadScene("AdScene");
        }
        else
        {
            if (PlayerPrefs.GetInt("GameMode") == GameMode.Target.GetHashCode() ||
                PlayerPrefs.GetInt("GameMode") == GameMode.Catch.GetHashCode() ||
                PlayerPrefs.GetInt("GameMode") == GameMode.Breakout.GetHashCode() ||
                PlayerPrefs.GetInt("GameMode") == GameMode.Tournament.GetHashCode())
            {
                SceneManager.LoadScene("ChallengesMenu");
            }
            else
            {
                SceneManager.LoadScene("CharSelScene");
            }
        }
    }