void ChangeLevelRespawn() { IDataSaver saver = this.gameSaver.GetSaver("/local/start", false); string targetScene = saver.LoadData("level"); string targetDoor = saver.LoadData("door"); SceneDoor.StartLoad(targetScene, targetDoor, this._fadeOut, this.gameSaver, null); }
public static void LoadScene(string scene, string spawn = "", bool doSave = true, bool doFade = true, EffectHelper.FadeType fadeType = EffectHelper.FadeType.Circle, Color?fadeColor = null, float fadeOutTime = 0.5f, float fadeInTime = 1f) { // If saving, trigger save if (doSave) { SaveManager.SaveToSaveFile("start/level", scene); SaveManager.SaveToSaveFile("start/door", spawn); } // If no fade, load scene instantly if (!doFade) { SceneManager.LoadScene(scene); return; } // If fading, make fade & trigger load FadeEffectData fadeData = EffectHelper.MakeFadeEffect(fadeType, fadeColor, fadeOutTime, fadeInTime); SceneDoor.StartLoad(scene, spawn, fadeData, SaveManager.GetSaverOwner()); }