- Home /
Question by
jamesc554544 · Nov 22, 2014 at 11:10 PM ·
load level
Async Level Loading Not Working
I Could Do With Some Advice As My Level Will Not Load.
using UnityEngine;
using System.Collections;
public class ButtonScript : MonoBehaviour {
public bool Play, Options, Video, Sound, Exit, Back;
private bool doneLoadingScene;
private AsyncOperation asyncOperation;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if(asyncOperation != null && !doneLoadingScene)
{
Debug.Log("Scene Load Progress: " + asyncOperation.progress * 100f);
if(asyncOperation.isDone)
{
doneLoadingScene = true;
Debug.Log("SCENE DONE LOADING!");
}
}
}
void OnMouseDown()
{
if (Play)
{
//Application.LoadLevel("Level 1");
LoadLevels();
}
}
IEnumerator LoadLevels()
{
asyncOperation = Application.LoadLevelAsync(1);
yield return asyncOperation;
}
}
Comment
Answer by psycocrusher · Nov 22, 2014 at 11:34 PM
it should load if you remove asyncOperation.isDone
Answer by Jignesh G. · Nov 23, 2014 at 06:42 PM
Most IMP
Async level load requires unity Pro license.
Your answer
Follow this Question
Related Questions
Loading scene from asset bundle fails in Unity 4 2 Answers
Static batching not working... 0 Answers
,Restart Scene after level Completion 0 Answers
Application.LoadLevelAsync ... loading screen is freezing 0 Answers
How to keep "Loading" animation from freezing while loading a large level? 2 Answers