public static void UpdateLose() { Log.WriteLog("Update scores after death.", Log.LevelsOfLogs.INFO, "ScoreManager"); switch (gameMode) { case GameModes.Modes.Classic: PlayerPrefs.SetInt(PlayerPrefsKeys.BestScoreClassic, bestScore); break; case GameModes.Modes.Challenge: PlayerPrefs.SetInt(PlayerPrefsKeys.BestScoreChallenge, bestScore); break; } MoneyManager.AddResourcesAfterGame(score); updateLoseUI?.Invoke(new ScoreUpdateUIEventArgs(scoreAllLoop, bestScore)); }