- Home /
LoadLevelAsync and load data before allowSceneActivation
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 loadset 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
There has been a troll downvoting for no reason. Don't get it bad, he is gone (until back under a new name). So your question is not stupid. he is.
Answer by InfiniBuzz · Jun 26, 2013 at 08:14 AM
I just didn't think enough.
I now have the UI (containing the loading screen) not destroying on load too and destroy it after everything is loaded.
facepalm :)
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Level dont loaded, after enter a Trigger BoxCollider 1 Answer
cardboard gazed at to load new scene 0 Answers