For testing purposes I've made a Unity UI dropdown menu that is automatically populated with all scenes in the project. I can load any scene from this menu by using:
UnityEngine.SceneManagement.SceneManager.LoadScene(dropdown.value, LoadSceneMode.Single);
but this causes some bugs, and I believe AC does some other stuff under the hood when loading a scene. Is there a way to load a scene from a script when you know the scenes' number?
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Yes, you need to use AC's own ChangeScene function in order to properly handle the saving/loading of data during switching:
Replace "true" with "false" to avoid saving the current scene's data.
Thanks, works perfectly! Recommend doing something like this if you have a project with many scenes and you want to playtest them on a device
To be clear, though: this should only be necessary if you're starting from an AC scene. If your opening scene isn't an AC one, then you should be able to switch scene using Unity's provided functions.
Good to know. I had to implement an extra menu removal function, so it might be easier to just make a standard Unity scene for device testing purposes.