Exemplo n.º 1
0
 public static UniTask <AssetBundle> ToUniTask(this AssetBundleCreateRequest asyncOperation, IProgress <float> progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellationToken = default(CancellationToken))
 {
     Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation));
     if (asyncOperation.isDone)
     {
         return(UniTask.FromResult(asyncOperation.assetBundle));
     }
     return(new UniTask <AssetBundle>(AssetBundleCreateRequestConfiguredSource.Create(asyncOperation, timing, progress, cancellationToken, out var token), token));
 }
Exemplo n.º 2
0
 public static UniTask <AssetBundle> WithCancellation(this AssetBundleCreateRequest asyncOperation, CancellationToken cancellationToken)
 {
     Error.ThrowArgumentNullException(asyncOperation, nameof(asyncOperation));
     if (asyncOperation.isDone)
     {
         return(UniTask.FromResult(asyncOperation.assetBundle));
     }
     return(new UniTask <AssetBundle>(AssetBundleCreateRequestConfiguredSource.Create(asyncOperation, PlayerLoopTiming.Update, null, cancellationToken, out var token), token));
 }