void GameOver() { if (currentLevel <= 2) { PlayAnimation.WarnForBadLand(); GameElements.NormalLand(); GameElements.isResetingPlayer = true; ResetPlayer.StartReseting(); return; } else if (hasContinuedPlaying == false && diamondsNo >= 200) { PlayAnimation.GameOverAnim(false, hasContinuedPlaying); hasContinuedPlaying = true; GameElements.HoldGame(true); PlayerPrefs.SetInt("diamonds", diamondsNo); goDiamondsNo.text = diamondsNo + "<sprite index=0>"; return; } if (currentLevel > PlayerPrefs.GetInt("MaxLevel", 1)) { PlayerPrefs.SetInt("MaxLevel", currentLevel); } score += (tmpScore * perfectInRow); GameElements.SubmitScoreForAnalytics(score); PlayerPrefs.SetInt("LastScore", score); lastScoreTxt.text = lastScoreTxtGO.text = "Last:\n" + score; perfectInRow = 1; tmpScore = 0; if (score > highScore) { PlayerPrefs.SetInt("HighScore", score); highScoreTxtGO.text = "New Best:\n" + PlayerPrefs.GetInt("HighScore", 0); PlayAnimation.GameOverAnim(true, true); } else { highScoreTxtGO.text = "Best:\n" + PlayerPrefs.GetInt("HighScore", 0); PlayAnimation.GameOverAnim(false, true); } //if (PlayerPrefs.GetInt("diamonds", 0) < diamondsNo) PlayerPrefs.SetInt("diamonds", diamondsNo); PlayerPrefs.Save(); GameElements.GameOver(); }