public void ReloadScene(Scene actualScene) { if (File.Exists(Application.persistentDataPath + "/rbSave.bp")) { SceneManager.LoadScene(actualScene.name); } else { currentScene = SceneEnum.StoryboardN1; SceneManager.LoadScene(currentScene.ToString()); } }
/// <summary> /// It loads the "Loading" scene but the param is saved for future uses. /// </summary> /// <param name="sceneIndex"></param> public void LoadNextScene(SceneEnum sceneIndex) { if (File.Exists(Application.persistentDataPath + "/rbSave.bp")) { currentScene = sceneIndex; SceneManager.LoadScene(SceneEnum.Loading.ToString()); } else { currentScene = SceneEnum.StoryboardN1; SceneManager.LoadScene(currentScene.ToString()); } }
public static void LoadSceneByID(SceneEnum targetScene) { string targetSceneName; if (sceneNames.TryGetValue(targetScene, out targetSceneName)) { SceneManager.LoadScene(targetSceneName); } else { Debug.LogError("Scène inconnue : " + targetScene.ToString()); } }
public void Update() { if (next != SceneEnum.None) { if (opacity >= 1) { UnityEngine.SceneManagement.SceneManager.LoadScene(next.ToString()); } opacity += Time.deltaTime * speed; } else if (opacity > 0) { opacity -= Time.deltaTime * speed; } GetComponent <UnityEngine.UI.Image>().color = new Color(0f, 0f, 0f, opacity); }
public static void FadeTo(SceneEnum _scene, Color _col, float _fadeSpeed) { if (isFading) { return; } Time.timeScale = 1; isFading = true; GameObject init = new GameObject(); init.name = "Fader"; init.AddComponent <Fader>(); Fader fader = init.GetComponent <Fader>(); fader.fadeSpeed = _fadeSpeed; fader.fadeScene = _scene.ToString(); fader.fadeCol = _col; }
public void LoadNewScene() { StartCoroutine(CallFadeScene(changeTimer, scene.ToString())); }
/// <summary> /// The method accesses a new scene through the SceneEnum enumerator /// </summary> /// <param name = "newLevel">The new scene in enumerator</param> public void ObeyEnterNewLevel(SceneEnum newLevel) { SceneManager.LoadScene(newLevel.ToString()); }
public void ChangeScene(SceneEnum sceneEnum) { scene = sceneEnum.ToString(); StartCoroutine(ToLoadingScene()); }
public void checkPointSaveStatus() { ElfStatus.SaveSelfGameStatus(scene.ToString(), transform.position); }
/// <summary> /// The method accesses a new scene through the enumerator /// </summary> /// <param name = "newLevel">The new scene in enumerator</param> public void NewScene(SceneEnum newLevel) { SceneManager.LoadScene(newLevel.ToString()); }
void switchScenes() { GlobalGameStateManager.CurrentScene = scene; Application.LoadLevel(scene.ToString()); }
private string _GetSceneNameByEnum(SceneEnum scene) { return(scene.ToString()); }