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?
troien
March 22, 2016, 8:03pm
2
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:
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
Except that it doesn’t work for me Let me know if you get it working.