From c99d3eb3c3ebee0a9de569ac4dad6f11f70f100d Mon Sep 17 00:00:00 2001 From: Yoshifumi Kawai Date: Wed, 5 Aug 2020 15:55:09 +0900 Subject: [PATCH] Update README.md --- README.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e0e2898..43e7c0d 100644 --- a/README.md +++ b/README.md @@ -154,22 +154,19 @@ 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 async UniTaskVoid LoadManyAsync() { - public SceneAssets() - { - // parallel load. - var (a, b, c) = await UniTask.WhenAll( - LoadAsSprite("foo"), - LoadAsSprite("bar"), - LoadAsSprite("baz")); - } + // parallel load. + var (a, b, c) = await UniTask.WhenAll( + LoadAsSprite("foo"), + LoadAsSprite("bar"), + LoadAsSprite("baz")); +} - async UniTask LoadAsSprite(string path) - { - var resource = await Resources.LoadAsync(path); - return (resource as Sprite); - } +async UniTask LoadAsSprite(string path) +{ + var resource = await Resources.LoadAsync(path); + return (resource as Sprite); } ```