Example #1
0
        public static void UnloadSceneAsync(SceneUnloadArg arg)
        {
            if (!arg.IsValid)
            {
                Debug.LogError("Scene operation cancelled.");
                return;
            }

            if (!IsLoading)
            {
                GameObject gameObj = new GameObject("Scene Progress");
                gameObj.AddComponent <SceneLoader>();

                SourceScene = gameObj.scene.path;

                DontDestroyOnLoad(gameObj);
            }

            sceneOperationQueue.Enqueue(Instance.UnloadSceneAsyncCoroutine(arg));
        }
Example #2
0
 private IEnumerator UnloadSceneAsyncCoroutine(SceneUnloadArg arg)
 {
     yield return(StartCoroutine(UnloadSceneAsyncCoroutine(arg.UnloadUnusedAssets, arg.ScenePathsToUnload)));
 }