public int GetLevelHighScore(LevelInfo sentInfo) { int tempHighScore = 0; try { tempHighScore = PlayerPrefs.GetInt("highscore_" + sentInfo.Name, 0); } catch (System.Exception e) { e.ToString(); Debug.Log("No player prefs score"); } try { Debug.Log("PlayerPref HighScore: " + tempHighScore); int leaderBoardHighScore = socialManager.GetHighScoreFromLeaderBoard(sentInfo.ID); Debug.Log("Leaderboard HighScore: " + leaderBoardHighScore); if (tempHighScore < leaderBoardHighScore) { PlayerPrefs.SetInt("highscore_" + sentInfo.ID, leaderBoardHighScore); tempHighScore = leaderBoardHighScore; } } catch (System.Exception e) { e.ToString(); } return(tempHighScore); }