|
10 | 10 |
|
11 | 11 | namespace MyUnityTools.SceneLoading.AddressablesSupport.UniTaskSupport |
12 | 12 | { |
| 13 | + /// <summary> |
| 14 | + /// Interface to standardize async addressable scene operations with <see cref="UniTask"/>. |
| 15 | + /// </summary> |
13 | 16 | public interface IAddressableSceneLoaderUniTask : IAddressableSceneLoader |
14 | 17 | { |
| 18 | + /// <summary> |
| 19 | + /// Triggers a scene transition asynchronously. |
| 20 | + /// It will transition from the current active scene (<see cref="IAddressableSceneManager.GetActiveSceneHandle"/>) |
| 21 | + /// to the target scene (<paramref name="targetSceneReference"/>), with an optional intermediate loading scene (<paramref name="intermediateSceneReference"/>). |
| 22 | + /// If the <paramref name="intermediateSceneReference"/> is not set, the transition will have no intermediate loading scene and will instead simply load the target scene directly. |
| 23 | + /// The complete transition flow is: |
| 24 | + /// <br/><br/> |
| 25 | + /// 1. Load the intermediate scene (if provided).<br/> |
| 26 | + /// 2. Load the target scene.<br/> |
| 27 | + /// 3. Unload the intermediate scene (if provided).<br/> |
| 28 | + /// 4. Unload the previous scene |
| 29 | + /// </summary> |
| 30 | + /// <param name="targetSceneReference"> |
| 31 | + /// The scene that's going to be transitioned to. |
| 32 | + /// Can be the scene's addressable <see cref="UnityEngine.AddressableAssets.AssetReference"/> (<see cref="AddressableLoadSceneReferenceAsset"/>) |
| 33 | + /// or runtime key (<see cref="AddressableLoadSceneReferenceKey"/>). |
| 34 | + /// </param> |
| 35 | + /// <param name="intermediateSceneReference"> |
| 36 | + /// The scene that's going to be loaded as the transition intermediate (as a loading scene). |
| 37 | + /// Can be the scene's addressable <see cref="UnityEngine.AddressableAssets.AssetReference"/> (<see cref="AddressableLoadSceneReferenceAsset"/>) |
| 38 | + /// or runtime key (<see cref="AddressableLoadSceneReferenceKey"/>). |
| 39 | + /// If null, the transition will not have an intermediate loading scene. |
| 40 | + /// </param> |
| 41 | + /// <returns>The transition awaitable <see cref="UniTask{TResult}"/>"/> with the resulting <see cref="SceneInstance"/>.</returns> |
15 | 42 | UniTask<SceneInstance> TransitionToSceneAsync(IAddressableLoadSceneReference targetSceneReference, IAddressableLoadSceneReference intermediateSceneReference = null); |
16 | 43 |
|
| 44 | + /// <summary> |
| 45 | + /// Loads a scene additively asynchronously on top of the current scene stack, optionally marking it as the active scene |
| 46 | + /// (<see cref="IAddressableSceneManager.SetActiveSceneHandle(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle{UnityEngine.ResourceManagement.ResourceProviders.SceneInstance})"/>). |
| 47 | + /// </summary> |
| 48 | + /// <param name="sceneInfo"> |
| 49 | + /// The scene that's going to be loaded. |
| 50 | + /// Can be the scene's addressable <see cref="UnityEngine.AddressableAssets.AssetReference"/> (<see cref="AddressableLoadSceneReferenceAsset"/>) |
| 51 | + /// or runtime key (<see cref="AddressableLoadSceneReferenceKey"/>). |
| 52 | + /// </param> |
| 53 | + /// <param name="setActive"> |
| 54 | + /// Should the loaded scene be marked as active? |
| 55 | + /// Equivalent to calling <see cref="IAddressableSceneManager.SetActiveSceneHandle(UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle{UnityEngine.ResourceManagement.ResourceProviders.SceneInstance})"/>. |
| 56 | + /// </param> |
| 57 | + /// <returns>The load awaitable <see cref="UniTask{TResult}"/>"/> with the resulting <see cref="SceneInstance"/>.</returns> |
17 | 58 | UniTask<SceneInstance> LoadSceneAsync(IAddressableLoadSceneReference sceneReference, bool setActive = false); |
18 | 59 |
|
| 60 | + /// <summary> |
| 61 | + /// Unloads the given scene asynchronously from the current scene stack. |
| 62 | + /// </summary> |
| 63 | + /// <param name="sceneInfo"> |
| 64 | + /// Target scene info. |
| 65 | + /// Can be the scene's addressable <see cref="UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle{TObject}"/> (<see cref="AddressableLoadSceneInfoOperationHandle"/>), |
| 66 | + /// its <see cref="UnityEngine.ResourceManagement.ResourceProviders.SceneInstance"/> (<see cref="AddressableLoadSceneInfoInstance"/>), |
| 67 | + /// or its name (<see cref="AddressableLoadSceneInfoName"/>). |
| 68 | + /// </param> |
| 69 | + /// <returns>The unload awaitable <see cref="UniTask"/>.</returns> |
19 | 70 | UniTask UnloadSceneAsync(IAddressableLoadSceneInfo sceneInfo); |
20 | 71 | } |
21 | 72 | } |
|
0 commit comments