void SetScoreBasedOnDifficulty() { if (JachTheGiant_GamePreferences.GetEasyDifficultyState() == 1) { SetScore(JachTheGiant_GamePreferences.GetEasyDifficultyHighScore(), JachTheGiant_GamePreferences.GetEasyDifficultyCoinScore()); } if (JachTheGiant_GamePreferences.GetMediumDifficultyState() == 1) { SetScore(JachTheGiant_GamePreferences.GetMediumDifficultyHighScore(), JachTheGiant_GamePreferences.GetMediumDifficultyCoinScore()); } if (JachTheGiant_GamePreferences.GetHardDifficultyState() == 1) { SetScore(JachTheGiant_GamePreferences.GetHardDifficultyHighScore(), JachTheGiant_GamePreferences.GetHardDifficultyCoinScore()); } }
public void CheckGameStatus(int score, int coinScore, int lifeScore) { if (lifeScore < 0) { if (JachTheGiant_GamePreferences.GetEasyDifficultyState() == 1) { int highScore = JachTheGiant_GamePreferences.GetEasyDifficultyHighScore(); int coinHighScore = JachTheGiant_GamePreferences.GetEasyDifficultyCoinScore(); if (highScore < score) { JachTheGiant_GamePreferences.SetEasyDifficultyHighScore(score); } if (coinHighScore < coinScore) { JachTheGiant_GamePreferences.SetMediumDifficultyCoinScore(coinScore); } } if (JachTheGiant_GamePreferences.GetMediumDifficultyState() == 1) { int highScore = JachTheGiant_GamePreferences.GetMediumDifficultyHighScore(); int coinHighScore = JachTheGiant_GamePreferences.GetMediumDifficultyCoinScore(); if (highScore < score) { JachTheGiant_GamePreferences.SetMediumDifficultyHighScore(score); } if (coinHighScore < coinScore) { JachTheGiant_GamePreferences.SetMediumDifficultyCoinScore(coinScore); } } if (JachTheGiant_GamePreferences.GetHardDifficultyState() == 1) { int highScore = JachTheGiant_GamePreferences.GetHardDifficultyHighScore(); int coinHighScore = JachTheGiant_GamePreferences.GetHardDifficultyCoinScore(); if (highScore < score) { JachTheGiant_GamePreferences.SetHardDifficultyHighScore(score); } if (coinHighScore < coinScore) { JachTheGiant_GamePreferences.SetHardDifficultyCoinScore(coinScore); } } gameStartedFromMainMenu = false; gameRestartedAfterPlayerDied = false; JachTheGiant_GameplayController.instance.GameOverShowPanel(score, coinScore); } else { this.score = score; this.coinScore = coinScore; this.lifeScore = lifeScore; gameStartedFromMainMenu = false; gameRestartedAfterPlayerDied = true; JachTheGiant_GameplayController.instance.PlayerDiedRestartTheGame(); } }