I attempt to switch the scene from Scene1 to Scene2, so I create a “Loading Scene” in between. When I call Application.LoadLevel(“LoadingScene”) in Scene1 the transition scene loaded and play a simple animation. Then it loads the Scene2. I was using the following code on the animated object (the animation was created with sprite manager):
function Start()
{
StartCoroutine(LoadLevelParts());
var sprite : PackedSprite = GetComponent(PackedSprite);
sprite.PlayAnim(0);
}
function LoadLevelParts()
{
yield new WaitForSeconds(1);
Application.LoadLevel("ForestScene");
}
When I run this game it seems the loading scene always stop all its frames when it begins to load the next scene, and the animation just stop playing. So is there any other approach that can be used to force the animation continue playing until the next scene is successfully loaded? Can LoadLevel() and animation running synchronously?
That looks like a perfect solution to my problem. But I forgot to mention that I don’t have unity pro, I am using iPhone basic so Application.LoadLevelAsync() is not supported. Thanks for your help anyway. Maybe I will stick to a static loading scene at this time and try upgrade to unity pro later.
you could do LoadLevelAdditive, and and turn off your animation when loading is complete by checking isLoadingLevel or something. Neither of those are pro functions, AFAIK
My app is made up of many scenes. I’ve done this to keep the structure easy to maintain as the app will be updated in future releases (as part of a series).
I have a main menu scene from which all other scenes can be accessed via a click of a button. It’s the loading of these scenes from the menu that takes some time depending on the selected scene’s content amount. So I’m not sure how your suggestion above would work nor benefit.
Application.LoadLevelAsync is also not solution for this, even this kind of load level also stop all animation and frames which call from previous scene…
As far as I know there is still no solution to this. Which is really sad in my opinion. Almost every game needs a loading bar/animation/signal. Through loadlevelasync you can measure when the next scene actually loads, but this is NOT the problem. The problem is the “initialization” of the scene when the scene is loaded.
For me, the scene loads very quickly actually, however the initialization of the scene, and the parsing of shaders that Unity does in the background etc… is what takes the most time. And currently this freezes everything – including loading bars and loading icon animations.
Why is there no easy solution for this yet? Asset bundles seem like a crazy workaround for something that should come standard with a game engine.
The ability to just have a loading icon that doesn’t freeze through level loading is heavily desired Unity. Please work on this. I’ve seen Unity games that have to resort to a static loading screen, because there’s no accurate way to present the loading and initialization time of the scene to the user.
Well the solution for me was the one suggest in this subject : Simple animation during loading = NOT possible in Unity ?!?! . Using SceneManager.LoadSceneAsync() works fine, I can play a loading animation with a circle rotation (with animator or script).
The problem is that it won’t work in Unity Editor but if you build and run the application, it works fine. I hope it helps someone.