I have the following flow of scenes for my game, from startup:
splash screen scene
(loading)
main menu scene -> choose new game
(loading)
game scene
This works perfectly, with the loading scene working through AC and showing loading progress. Everything is fine there.
But, I decided to start toying with scene preloading in an effort to reduce load times, and that's where the problem has come up. If I have a loading screen enabled, and preload the next scene, when AC attempts to actually load that next scene, the game freezes. I've tested this in a blank project and it does the same thing. Without a loading screen, however, preloading doesn't cause any problems. I think this is a bug.
But this leads me to another question: how exactly should we be using preloading? I noticed that the action is a dead-end; I can't have another action after it (in, for example, the on-scene start cutscene of my splash screen). So I set up a separate action list (set to run in the background) which is then called as the scene starts, and then the rest of the cutscene plays out (wait, camera fade, etc).
Is this the correct procedure, or is there a better way to preload scenes? I kept an eye on my RAM usage while testing and it doesn't seem like the preloading is actually doing anything. I certainly haven't noticed any decrease in loading times.
Any help would be appreciated!
Comments
I'm not sure if the main issue here is actually down to Unity or AC. The way Unity handles scene changing has also changed much with 5.3 - which version are you using?
I've always assume that when you preload, it'll only make a difference if that scene is the next one to actually get switched to - in which case, loading scenes and preloading can't really be used together, as the preload data will be discarded by Unity when the loading scene is loaded.