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());
     }
 }
Beispiel #3
0
    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());
        }
    }
Beispiel #4
0
        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);
        }
Beispiel #5
0
    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;
    }
Beispiel #6
0
 public void LoadNewScene()
 {
     StartCoroutine(CallFadeScene(changeTimer, scene.ToString()));
 }
Beispiel #7
0
 /// <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());
 }
Beispiel #8
0
 public void ChangeScene(SceneEnum sceneEnum)
 {
     scene = sceneEnum.ToString();
     StartCoroutine(ToLoadingScene());
 }
 public void checkPointSaveStatus()
 {
     ElfStatus.SaveSelfGameStatus(scene.ToString(), transform.position);
 }
Beispiel #10
0
 /// <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());
 }
Beispiel #11
0
 void switchScenes()
 {
     GlobalGameStateManager.CurrentScene = scene;
     Application.LoadLevel(scene.ToString());
 }
 private string _GetSceneNameByEnum(SceneEnum scene)
 {
     return(scene.ToString());
 }