As of Unity 5.2, Application.isLoadingLevel appears to be deprecated. I’ve used this bool extensively in the editor to ensure that certain internal operations/events do not perform while editor scenes are being loaded as well as while switching to play mode in the editor (which also triggered a scene load).
The solution given by the deprecation warning is as follows :
warning CS0618: UnityEngine.Application.isLoadingLevel is obsolete: This property is deprecated, please use LoadLevelAsync to detect if a specific scene is currently loading.
However, Application.LoadLevelAsync appears to pertain to loadScene operations. Since I am not manually loading any scene, I cannot see how it is applicable. If not Application.isLoadingLevel, what solutions are available to detect when the Unity Editor itself is loading/changing a scene?
U5.2> API
When you are loading use: SceneManager.LoadAsynLevel instead of Application.loadLevelAsync. This loading is async on other thread vs Main thread compared to Application.loadLevel.
you can use: AsyncOperation async = Application.LoadLevelAsync(SceneManager.GetActiveScene().buildIndex);
and then instead Application.isLoading use !async.isDone to check.
In Editor as you don’t have control of scene loading, you can instead of check in some loop Applicaiton.isLoading you will check SceneManager.GetActiveScene().isLoaded and use callbacks for loading completion SceneManager.sceneLoadedor change: SceneManager.activeSceneChanged