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)); }
private IEnumerator UnloadSceneAsyncCoroutine(SceneUnloadArg arg) { yield return(StartCoroutine(UnloadSceneAsyncCoroutine(arg.UnloadUnusedAssets, arg.ScenePathsToUnload))); }