How to switch between Scenes in Multi-scene view?

569 Views Asked by At

I'm testing out this new feature of Unity, allowing to have multiple scenes opened at once. I wonder how to load or unload a certain scene without having the main one (which is basicly UI) closed. I couldn't find any tutorials

1

There are 1 best solutions below

0
Mike dg On

You'll want to use the SceneManager and the additive loading capability. Additive loading means that previous scenes will not be cleared out when the new scene loads.

       SceneManager.LoadScene("YourScene", LoadSceneMode.Additive); //Additive
       SceneManager.LoadScene("YourScene", LoadSceneMode.Single); //Conventional loading

Just remember that the lighting settings from the active scene will be used for all scenes. This is typically the first scene loaded unless you manually set it like below.

            SceneManager.SetActiveScene(SceneManager.GetSceneByName("Scene2"));

Some more details can be found at: https://docs.unity3d.com/ScriptReference/SceneManagement.LoadSceneMode.Additive.html https://docs.unity3d.com/ScriptReference/SceneManagement.SceneManager.html