2D Toolkit Forum
2D Toolkit => Support => Topic started by: VeTaL on May 12, 2012, 10:24:14 am
-
Is it possible to have such kind of event? As i told before, i have lots of quite heavy animation. I'd like to know, when it loads completely (to show a loading screen, or so).
-
You have to deal with this like with any other Unity object. If you have the animation in a second scene, you can use Application. LoadLevelAdditiveAsync to load your level while your "Loading..." level is in the foreground. Once the level has loaded, you can hide and destory the "loading" object.
-
And what about first level?
Should i use it this way ?
1) show a picture (or animation) with "Loading" line - actually, not just a picture, but a whole level
2) during it, Application.LoadLevelAsync
3) when finished, destroy picture
PS: i hope, this one also would be useful for other users
-
Yes pretty much that. You can do it on any level really, even for the startup scene.
-
Ok, i'll share working results, if needed :)
-
Oh yeah I should mention, if you intend on doing an animated loading scene, you'll need Unity pro as that function will block in the free version.
-
Pretty simple. I made an empty level with simple cycling animation. And this code, attached to object.
private AsyncOperation ao;
void Start()
{
ao = Application.LoadLevelAsync("Level1");
if (ao != null)
{
//GUI.Box(new Rect(0, Screen.width - 40, ao.progress * Screen.width, 40), "");
Debug.Log(ao.progress.ToString());
}
}