You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added:
- Switching between an asynchronous model `.Net` / `UniTask`
- Complete Coroutine base operations for addressables management
- Complete UniTask base operations for addressables management
@@ -58,7 +56,9 @@ Open `Packages/manifest.json` with your favorite text editor. Add the following
58
56
59
57
## How to use
60
58
61
-
Plugin nampespace first.
59
+
### Intro
60
+
61
+
Plug in namespace first.
62
62
63
63
```c#
64
64
usingAddressablesMaster;
@@ -70,24 +70,30 @@ All basic features for asset management are available along the following path:
70
70
ManageAddressables.[SOME_COMMAND];
71
71
```
72
72
73
-
The `AddressablesMaster` implements the ability to manage assets in several ways, synchronously, asynchronously and coroutines.
73
+
Below is a list of operations that are available in each control model:
74
74
75
-
> Important! The use of an asynchronous model depends on the presence of `UniTask` in the project, if it does not exist in the project, then the `.NET` async system is used by default, if the project has `UniTask`, then it is used.
75
+
- Initialize
76
+
- LoadLocations
77
+
- LoadAsset
78
+
- LoadScene
79
+
- UnloadScene
80
+
- Instantiate
81
+
- InstantiateWithAutoRelease
76
82
77
-
No matter which management model you use, each has basic control operations with its own unique implementation. For example this is how initialization looks like on each model:
83
+
If you are using the `UniTask` in a project and want to use it in an asynchronous control model, then connect it by following the path `Tools > Addressables Master > UniTask > On`.
84
+
`.NET` asynchronous operating model is used by default.
85
+
> Carefully! If you switch the asynchronous model, all existing code will be invalidated as each model has its own implementation.
@@ -96,35 +102,45 @@ public class AssetReferenceMaterial : AssetReferenceT<Material>
96
102
}
97
103
```
98
104
99
-
### Sync
105
+
`Sync`
100
106
101
-
When using a synchronous operation script, in response to a command output that has a return value, you will receive a value of the type specified in the signature of the operation being called, this seems obvious, but for example, by calling the same operation using the asynchronous model, you will get a custom type similar to an `AsyncOperationHandle`.
When using a synchronous operation script, in response to a command output that has a return value, you will get a `Task` that contains as a result a custom class named `OperationResult` with several fields, `Succeeded` and `Value`. You can process this data in accordance with the logic of your project.
When you load an addressable asset, you should release it as soon as you don't need it anymore, forgetting to do this can lead to many bad processes at runtime. Using the `Addressables Master` you can bind a release to the `GameoObject` that will do it for you automatically as soon as it is destroyed.
127
141
142
+
The `Addressables Master` has two ways to manage the release of objects, the first is to use [methods of extending the basic operations](#addressables-extensions) of the Addressables, the second is to use separate methods of life management.
143
+
128
144
#### Addressables Extensions
129
145
130
146
If you need to use standard operations for working with addressables assets, then you can use the extensions.
@@ -141,7 +157,7 @@ public static async Task<AsyncOperationHandle<T>> AddAutoRelease<T>(this AsyncOp
0 commit comments