Persist LoadLevel()'s "levelName" variable across scenes
Posted: Wed Mar 20, 2019 1:41 pm
Hello!
Lately, i have been working on scene transitions in my project and i need to have a "main scene" that connects to a "loading scene" (for that using the LoadLevel() sequencer command), which by its turn (being a "lighter" scene) will start loading the "next level scene" with (UnityEngine.SceneManagement.SceneManager.LoadSceneAsync). To do this i need to be able to keep the LoadLevel()'s sequencer command "levelName" variable when i call this function from the "main scene", so that i can refer to it in my custom scene loader, which is essentially this line: "LoadSceneAsync(levelName)".
In my project i have one important limitation which is that i cannot rely on UI to fade in or fade out of scenes, i am saying this since i know there are some UI based alternatives to deal with scene transitions.
Lately, i have been working on scene transitions in my project and i need to have a "main scene" that connects to a "loading scene" (for that using the LoadLevel() sequencer command), which by its turn (being a "lighter" scene) will start loading the "next level scene" with (UnityEngine.SceneManagement.SceneManager.LoadSceneAsync). To do this i need to be able to keep the LoadLevel()'s sequencer command "levelName" variable when i call this function from the "main scene", so that i can refer to it in my custom scene loader, which is essentially this line: "LoadSceneAsync(levelName)".
In my project i have one important limitation which is that i cannot rely on UI to fade in or fade out of scenes, i am saying this since i know there are some UI based alternatives to deal with scene transitions.