Help us understand the problem. What is going on with this article?

Unity5.5でUnloadSceneAsync()が実装されてUnloadScene時にフリーズしなくなった

More than 3 years have passed since last update.

特定の場所でUnloadSceneをするとUnityがフリーズするバグに見舞われていて

http://qiita.com/vjbab/items/62d43b57bc1e3740a4d1
https://issuetracker.unity3d.com/issues/unity-hangs-on-scenemanager-dot-unloadscene

おそらくこのあたりで紹介されているもの

I found i way around this, instead os just calling UnloadScene, create a coroutine that when the trigger recives a on enter event wait for the end of frame then unload the scene.

Like this:

yield return new WaitForEndOfFrame();
SceneManager.UnloadScene("MyScene");

結局こんな感じに処理して対応してたんだけどUnity5.5でUnloadSceneAsyncが追加されてた。

https://unity3d.com/jp/unity/whats-new/unity-5.5.0

SceneManager: UnloadScene has now be marked deprecated and will throw an exception if called at illegal times. UnloadSceneAsync should be used instead (762371)

上記のissueのIDと一致してるし、これからはUnloadSceneAsync()を使えばいいらしい。

sa-k0
たまになにかかきます
https://biwanoie.tokyo
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away