int CalculateHighScore(int score) { int PreviousHighScore = PlayerPrefs.GetInt("high_score", 0); if (score > PreviousHighScore) { PlayerPrefs.SetInt("high_score", score); SocialManager.PostToLeaderboard((int)score); } return(PlayerPrefs.GetInt("high_score", 0)); }