public async UniTask LoadSceneAsync( int buildIdx, bool setActiveAsMainScene = false, Action <AsyncOperation> onStarted = null, Action onCompleted = null, bool allowSceneActivation = true, AsyncOperationProgress onProgress = null) { if (buildIdx == -1) { return; } if (!_loadedScenes.Contains(buildIdx)) { _loadedScenes.Add(buildIdx); } else { return; } await UniRxAsyncSceneManagementSingleton.LoadSceneAsync( buildIdx, setActiveAsMainScene, onStarted, onCompleted, allowSceneActivation, onProgress); }
public async UniTask UnloadSceneAsync( int buildIdx, Action onCompleted = null) { if (buildIdx == -1) { return; } if (SceneManagementSingleton.IsSceneInBackground(buildIdx)) { return; } _loadedScenes.Remove(buildIdx); await UniRxAsyncSceneManagementSingleton.UnloadSceneAsync(buildIdx, onCompleted); }