mirror of https://github.com/Cysharp/UniTask
Update README.md
parent
08d5183e7e
commit
c99d3eb3c3
|
@ -154,9 +154,7 @@ UniTask provides three pattern of extension methods.
|
|||
The type of `UniTask` can use utility like `UniTask.WhenAll`, `UniTask.WhenAny`. It is like Task.WhenAll/WhenAny but return type is more useful, returns value tuple so can deconsrtuct each result and pass multiple type.
|
||||
|
||||
```csharp
|
||||
public class SceneAssets
|
||||
{
|
||||
public SceneAssets()
|
||||
public async UniTaskVoid LoadManyAsync()
|
||||
{
|
||||
// parallel load.
|
||||
var (a, b, c) = await UniTask.WhenAll(
|
||||
|
@ -170,7 +168,6 @@ public class SceneAssets
|
|||
var resource = await Resources.LoadAsync<Sprite>(path);
|
||||
return (resource as Sprite);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If you want to convert callback to UniTask, you can use `UniTaskCompletionSource<T>` that is the lightweight edition of `TaskCompletionSource<T>`.
|
||||
|
|
Loading…
Reference in New Issue