SceneLoading

I’ve been browsing the API, but to no avail. Is there a way to know when a scene is finished loading? The second line of this always returns true:

SceneManager.LoadSceneAsync( serverInfo.sceneName, LoadSceneMode.Single );
Debug.Log( "isLoaded:" + SceneManager.GetActiveScene().isLoaded );

Is there a method called when the scene is finished loading? Is there a bool that will become true when the scene is finished loading?

I think you could use MonoBehaviour.OnLevelWasLoaded.

Another way I think is use the AsyncOperation that SceneManager.LoadSceneAsync() returns. (didn’t test this code as I currently don’t have Unity open, but I think is should look something like this)

private IEnumerator LoadMyScene()
{
    Debug.Log("Start");
    yield return SceneManager.LoadSceneAsync(serverInfo.sceneName, LoadSceneMode.Single);
    Debug.Log("Finished");
}

And call this using StartCoroutine

Officially, there is this:

Except that it doesn’t work for me :frowning: Let me know if you get it working.