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.
|
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
|
```csharp
|
||||||
public class SceneAssets
|
public async UniTaskVoid LoadManyAsync()
|
||||||
{
|
|
||||||
public SceneAssets()
|
|
||||||
{
|
{
|
||||||
// parallel load.
|
// parallel load.
|
||||||
var (a, b, c) = await UniTask.WhenAll(
|
var (a, b, c) = await UniTask.WhenAll(
|
||||||
|
@ -170,7 +168,6 @@ public class SceneAssets
|
||||||
var resource = await Resources.LoadAsync<Sprite>(path);
|
var resource = await Resources.LoadAsync<Sprite>(path);
|
||||||
return (resource as Sprite);
|
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>`.
|
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