void Start() { Time.timeScale = 1f; SpinnerGO.SetActive(true); manuallySwitchText.SetActive(false); if (tipsManager) { tipsManager.TipsText.gameObject.SetActive(true); } SceneTool.threadPriority = threadPriority; if (Prefs.Exist(Prefs.LOAD_LEVEL_NAME)) { string scene = Prefs.Game_LevelName(); LoadLevelAsync(scene); } else { SpinnerGO.GetComponentInChildren <Spinner>().isSpinning = false; Debug.LogError("Loading Error: There is no scene to load!"); } if (FindObjectOfType <Camera>() != null) { MainCamera = FindObjectOfType <Camera>().gameObject; } else { MainCamera = null; } }
public void SaveNextSceneData(string scene) { Prefs.Game_LoadState(2); Prefs.Game_LevelName(scene); JsonManager.ClearArray(); SaveGame(false); }
public void NewGame(string scene) { Prefs.Game_LoadState(0); Prefs.Game_SaveName(string.Empty); Prefs.Game_LevelName(scene); SceneManager.LoadScene(1); }
public void Load() { Prefs.Game_LoadState(1); Prefs.Game_SaveName(selectedSave.save); Prefs.Game_LevelName(selectedSave.scene); SceneManager.LoadScene(1); }
private IEnumerator LoadScene(string scene, int loadstate) { yield return(new WaitUntil(() => !saveHandler.fadeControl.isFading)); Prefs.Game_SaveName(saveHandler.lastSave); Prefs.Game_LoadState(loadstate); Prefs.Game_LevelName(scene); SceneManager.LoadScene(m_sceneLoader); }
public void Continue() { if (isSaveGame) { SavedGame saved = saveCache.Select(x => x.GetComponent <SavedGame>()).Where(x => x.save == lastSave).SingleOrDefault(); Prefs.Game_LoadState(1); Prefs.Game_SaveName(saved.save); Prefs.Game_LevelName(saved.scene); } else { Prefs.Game_LoadState(2); Prefs.Game_SaveName(lastSave); } SceneManager.LoadScene(1); }