- Home /
This question was
closed Oct 14, 2017 at 09:01 AM by
unity_G2yrNlWYdpJKuw.
Question by
unity_G2yrNlWYdpJKuw · Oct 09, 2017 at 03:53 PM ·
unity 5loadingload sceneloading screenloadlevelasync
unity LoadSceneAsync works like LoadScene
So I have this code :
AsyncOperation async;
public void Start ()
{
StartCoroutine (LoadingScreen ());
}
IEnumerator LoadingScreen ()
{
yield return new WaitForSeconds (1);
async = SceneManager.LoadSceneAsync (1);
async.allowSceneActivation = false;
while (!async.isDone) {
if (async.progress == 0.9f) {
async.allowSceneActivation = true;
}
yield return null;
}
}
The game still freezes before it loads another scene. I want the game to still smoothly load while it is loading a different scene, how can I do that? Have I done anything wrong with my code?
Comment