- Home /
Facebook Interaction LoadLevelAsync Progress Freezes
We have an animated loading screen that works well in the webplayer. However, once interacting with Facebook (ie, notifications, messages, accept login credentials) loading async no longer works.
The following code handles loading level async.
***
private void StartLoadingNow (string in_name)
{
// Load next level.
AsyncOperation loadingOperation = Application.LoadLevelAsync( in_name );
// Set this false to wait changing the scene
loadingOperation.allowSceneActivation = false;
StartCoroutine( LoadLevelProgress(loadingOperation) );
}
IEnumerator LoadLevelProgress (AsyncOperation in_loadingOperation)
{
float normTime = Mathf.Clamp01( (Time.time - m_startLoadingTime) / c_minimumLoadingTime );
while (!in_loadingOperation.isDone || // NOT , DONE
in_loadingOperation.progress < 0.9f || // progress less then 90%
normTime < 1.0f) // waiting for the time to transition
{
normTime = Mathf.Clamp01( (Time.time - m_startLoadingTime) / c_minimumLoadingTime );
Debug.Log ("Loading " + in_loadingOperation.progress + " time " + normTime + " " + Application.isLoadingLevel + " name " + Application.loadedLevelName);
// This is where I'm actually changing the scene
if (in_loadingOperation.progress >= 0.9f)
in_loadingOperation.allowSceneActivation = true;
yield return null;
}
Debug.Log ("Loading complete - " + in_loadingOperation.ToString() );
TransitionLoadComplete();
}
****
Depending on the browser and platform (PC vs Mac). I am getting various results.
Chrome PC Stuck at loading - Loading 0.03534362 time 1 True name dummy
Mozilla PC stuck at loading - Loading 0.7136916 time 1 True name dummy
Mac seems to crash out right after Facebooks OnFocus / OnHideUnity call.
Anyone else seeing issues similar to these ? Why would LoadLevelAsync freeze mid loading ? Is there a way to refresh all assets to ensure that they are all properly there ?
This issue is only occuring using the web player.
Your answer
Follow this Question
Related Questions
Webplayer Freeze / Crash After Facebook Interaction 0 Answers
Unity Web Player in Facebook: How to set the application name ? 1 Answer
Webplayer not recognized in IE and Facebook 1 Answer
WWW POST request headers gone on webplayer facebook 1 Answer
Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers