public void saveHighScore() //new for menu 2 { LevelStore ls = new LevelStore(); for (int x = 0; x < levels.Length; x++) { if (levels [x].levelName == curLevel) { ls = levels [x]; } } ScoreController sc = GameObject.FindGameObjectWithTag("GameController").GetComponent <ScoreController> (); Debug.Log("Saving high score " + sc.getScore() + " For level " + curLevel); ls.save(sc.getScore()); checkForLevelUnlocked(); }