- Home /
routine that checks when level is finished streaming and then loads it?
Hi! I have interesting problem, and i narrowed it down to routine that does not handle async loading of the streamed scenes.
everything worked fine, but when clearing cache in the browser or when i am starting webplayer first time on a different computer it does not want to load scene.
structure is like this: first scene is intro that show a splash screen seconds scene is main scene where all objects that are needed to run a game are present other scenes are levels
so from main scene i immediatly try to load first level with this part in the loading routine:
if(!Application.CanStreamedLevelBeLoaded(levelName))
{
progress.Reset();
progress.UpdateLabel("Wait..." + ((int)(Application.GetStreamProgressForLevel(levelName)*100)).ToString() + "%");
yield return null;
}
if(Application.CanStreamedLevelBeLoaded(levelName))
{
async = Application.LoadLevelAdditiveAsync(levelName);
progress.Reset();
progress.UpdateLabel("Loading...");
while(!async.isDone)
{
progress.Update(async.progress);
yield return 0;
}
}
it seems that it does not handle checking of the streamed level properly, if it is not yet streamed it just skips the whole thing..how exactly to handle this type of situation?
thanks!
Comment