public static void SaveHighscore(string name, int points) { // Print the highscore highscores.Add(new Highscore(points, name)); highscores.Sort(new HighscoreComparer()); JSONManager.Save("Highscores", highscores); // Reset variables PlayerSpawnPosition = Vector3.zero; playerStats = new PlayerStats(0, 1, 0); // Load main menu SceneManager.LoadScene("MainMenu"); }