Answers

Web Player and LoadLevelAsync

0

I am trying to get a web player to use LoadLevelAsync. Here are some of the problems.

If I set the web player to streaming, LoadLevelAsync seems to assume that the level is ready, and jump to it straight. The streaming is then interrupted. (I am not using the streaming levels functions because the user is allowed to select a level from a menu).

If the web player is not streaming, it will load all the levels and its assets, thus there is no need for LoadLevelAsync.

1) On a streaming webplayer, I get the standard Unity3D blue screen (ie, when the scene is empty). The web player just loads the new level without loading any assets or creating objects for the new level.

2) On a non-streaming webplayer, all levels were already loaded, so it makes no difference.

You need to use Application.GetStreamProgressForLevel() to check if the level has already been downloaded. LoadLevelAsync will not download the level for you, it will just load the level objects while you are still playing, so you get rid of that short loading hickup.

LoadLevelAsync allows you to load new levels while still playing the current one, show a progress bar or create a completely streaming world.

So if you have a menu level, you can load the level in the back while showing a loading bar and then switch to it, when it's ready :)

This is useful because when creating web players, you need to catch peoples attention fast. so a small starter level(plus dll's), play some music flashing color and so forth. then as soon as you'r in the menu, you start downloading lvl 1 so it's ready for the user.

In your scenario where the user can pick and choose, you really win download time for the menu level, but sadly you gotta download the level when the user pushes the button. Still useful because you can show a nice loading screen.

In addition to the above answers, be aware that the objects in your new level will have their Awake and Start functions called in the same thread as your loader level, so if all the work is happening in one of those functions, you're not going to see any incremental progress.