HI
I was wondering if it is possible to load data before the scene has finished loading.
I have a menu-scene and if the player hits a button I want to load my game scene and also load data. To load the data I plan to use whydoidoit’s Unity Serializer ( I didn’t implement that yet).
If the button is hit I display a “loading screen” but I don’t want it to disappear when the new scene is loading since the deserialization will take some time too.
What I quickly tried (and is not logical at all) is:
- Start loading the scene by calling
LoadLevelAsync
from a singleton class that is not destroyed on load - set the
allowSceneActivation
flag tofalse
- From a script in the new scene I tried to call a function in the singleton class to set
allowSceneActivation
totrue
As you can imagine at point 3 I cannot execute any code from the new scene before it has finished loading. Or can I?
I’d be surprised if its possible using this method.
Now how can I solve this problem?
Or is there a possibility built in the Unity Serializer?
Thanks