IEnumerator GoToNextLevel() { nextLvlTimer = 0; fadeScreen.gameObject.SetActive(true); while (nextLvlTimer < 225) { fadeScreen.color = Color.Lerp(fadeScreen.color, Color.black, Time.deltaTime * 4); nextLvlTimer += 4; if (nextLvlTimer > 223) { _loadingScreen.LoadScreen(); } yield return(new WaitForEndOfFrame()); } fadeScreen.color = _oldDarkColor; fadeScreen.gameObject.SetActive(false); if (nextLvl != Application.levelCount) { if (setPlayableLevel > _playerStats.playableLevels) { _playerStats.playableLevels = setPlayableLevel; } _saveLoadData.Save(SavePaths.currentPath); Application.LoadLevel(nextLvl); } else { _saveLoadData.Save(SavePaths.currentPath); _loadingScreen.loadingScreen.SetActive(false); fadeScreen.gameObject.SetActive(false); StartCoroutine(_wwwScreenShot.UploadPNG()); } }
public void UpdateQuestProgression(int quest, int value) { if (QuestData.quest == quest) { QuestData.questProgress = value; _save.Save(); } }
public void EndType() { if (_npc == Names.SPIKE_DEATH) { LoadingScreen.isLoading = true; Application.LoadLevel(4); } if (_quest >= QuestData.questDone) { QuestData.quest = _quest; if (_questProgress == 100) { QuestData.questDone = _quest; ResetPlayerQuestData(); } } if (_npc == Names.MALINCHE_START) { ResetPlayerQuestData(); QuestData.quest = 3; } else if (_npc == Names.END) { LoadingScreen.isLoading = true; Application.LoadLevel(4); } _autoType.index = 0; talk.StopTalk(); joystick.interact = false; _playerController.move = true; //print ("Quests Done:" + QuestData._questDone); save.Save(); }
void OnApplicationFocus(bool pauseStatus) { _paused = pauseStatus; if (!_paused) { _pauseScript.SetPaused(); save.Save(); } }
public void SaveHighscore() { _highscores[_currentLvl] = _score; _saveLoadData.Save(); }
public void MainMenu() { _saveLoadData.Save(SavePaths.currentPath); ChangeTimeScale(); Application.LoadLevel("Menu"); }
public void Load() { LoadingScreen.isLoading = true; Application.LoadLevel(level); save.Save(); }
public void BackToMainMenu() { LoadingScreen.isLoading = true; Application.LoadLevel(0); _saveLoadData.Save(); }