public void Win() { this.enabled = false; if (LevelsSaver.GetLevelCompletitionState(lastAccessedLevel) == false) { //Check level as complete LevelsSaver.SaveNewUnlockedLevel(lastAccessedLevel, true); //Unlock next levels foreach (int levelID in levelsToUnlock) { LevelsSaver.SaveNewUnlockedLevel(levelID, false); } } //return to Hub bool[] secretItemStates = secretItemsDatabase.GetSecretItemState(); if (lastAccessedLevel == 11) { if (secretItemStates[0] && secretItemStates[1] && secretItemStates[2]) { StartCoroutine(LoadScene(SECRET_ENDING_SCENE_PATH)); } else { StartCoroutine(LoadScene(NORMAL_ENDING_SCENE_PATH)); } LevelsSaver.ClearData(); return; } StartCoroutine(LoadScene(LEVEL_SELECT_SCENE_PATH)); }
public void ClearData() { LevelsSaver.ClearData(); ToMain(); StartCoroutine(Gamemanager.instance.LoadScene("LevelSelect")); }