When loading scenes in Unity is it better to load an empty scene then load the scene you are trying to reach or is it more efficient to just have a canvas UI cover the scene and wait for the scene to load directly then hide the canvas after the loading operation is complete?
I was curious about this, whether or not using one method over the other had any pros or cons as far as your application’s performance goes. Maybe there are reasons you’d want to do one over the other?
I searched online for quite some time and failed to find anything regarding this topic so I decide to post here. Maybe it would be better off in the forum, but any answers from folks who have experience with this sort of thing would be greatly appreciated.
It depends a lot on what your scene management looks like. The fastest method will be to load the next scene directly SceneManager.LoadScene("YourScene", LoadSceneMode.Single) which will unload the current scene first, so memory isn’t a concern. However, this severely limits the amount of control you have. Loading an empty scene, and then the scene you’re trying to get to will similarly lack control and won’t be any more flexible so there’s no reason for the extra step. Typically, you want to asynchronously load a lightweight loading scene (preferably with some sort of animated component so the player knows the game hasn’t simply frozen up), activate it, asynchronously unload the original scene, asynchronously load in the next scene, activate it, and finally asynchronously unload the loading scene. How you hide the transitions at each step is flexible, especially since you’re doing it all asynchronously and not freezing up the game. Of course, that’s just for a simple case where you aren’t merging scenes additively or trying to stream parts of large, open-world levels. That would require an entirely different set of approaches. As you get more complex requirements, the simple rules of thumb start to break down.