0
0

More than 5 years have passed since last update.

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

Posted at

特定の場所で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が追加されてた。

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()を使えばいいらしい。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0