void SaveProgress() { PlayerProgress currLevelProgress = new PlayerProgress( levelMode, levelNo, starPercent, timePassed, wrongTries, nextNumber, true, false ); ProgressController.SaveProgress(currLevelProgress); // If there is no level or we could not get one star, do not unlock next level. if (levelNo == levels.Count || starPercent < starPercents[0]) { UICont.DisableNextButton(); return; } // We have a next level, so unlock it. PlayerProgress nextLevelProgress = ProgressController.GetProgress(levelMode, levelNo + 1); nextLevelProgress.locked = false; ProgressController.SaveProgress(nextLevelProgress); }