I'm relatively new to Coroutines and Level Loading, so please forgive my presumably rookie mistake.
I'm calling the following function using StartCoroutine: public IEnumerator LoadLevel(string levelPath) { AsyncOperation loadOp = SceneManager.LoadSceneAsync(levelPath); while (!loadOp.isDone) { print("loading..."); yield return null; } print("loaded level"); }
The level loads, "loading..." is printed once, but the second print never occurs. What have I missed here, or not understood? I thought execution would carry on after the while loop was exited?
Thanks for the assistance!
I'm calling the following function using StartCoroutine: public IEnumerator LoadLevel(string levelPath) { AsyncOperation loadOp = SceneManager.LoadSceneAsync(levelPath); while (!loadOp.isDone) { print("loading..."); yield return null; } print("loaded level"); }
The level loads, "loading..." is printed once, but the second print never occurs. What have I missed here, or not understood? I thought execution would carry on after the while loop was exited?
Thanks for the assistance!