Last active
March 20, 2020 03:53
-
-
Save TakaakiIchijo/205680fe0dfca0e2eaab5590764581fc to your computer and use it in GitHub Desktop.
UniTaskを使ってADX2のキューシートロードをawaitしてCriAtomCueSheetを戻り値で返してくれるやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UniRx.Async; | |
public static class ADX2ExtensionsTask | |
{ | |
public static UniTask<CriAtomCueSheet>.Awaiter GetAwaiter(this CriAtomCueSheet cueSheet) | |
{ | |
UniTask<CriAtomCueSheet> task = new UniTask<CriAtomCueSheet>(async ()=> | |
{ | |
await UniTask.WaitWhile(() => cueSheet.IsLoading); | |
return cueSheet; | |
}); | |
return new UniTask<CriAtomCueSheet>.Awaiter(task); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CriAtom.AddCueSheetAsyncをawaitで待つことができる。