public void LoadStatistics() { this.stats = LevelStats.Deserialize(SceneManager.GetActiveScene().name); if (this.stats == null) { this.stats = new LevelStats(); } }
void Awake() { //PlayerPrefs.DeleteAll(); levelname = "Level" + " " + id; if (id > 1) { string prevLevel = "Level" + " " + (id - 1); LevelStats stats = LevelStats.Deserialize(prevLevel); if (stats == null || !stats.levelPassed) { but.interactable = false; } else { but.interactable = true; } } }