public static UniTask <UnityEngine.Object> ConfigureAwait(this ResourceRequest resourceRequest, IProgress <float> progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellation = default(CancellationToken)) { Guard.ThrowArgumentNullException(resourceRequest, nameof(resourceRequest)); var awaiter = new ResourceRequestConfiguredAwaiter(resourceRequest, progress, cancellation); PlayerLoopHelper.AddAction(timing, awaiter); return(new UniTask <UnityEngine.Object>(awaiter)); }
public static UniTask <UnityEngine.Object> ConfigureAwait(this ResourceRequest asyncOperation, IProgress <float> progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellation = default(CancellationToken)) { if (asyncOperation == null) { ThrowIfNull(nameof(asyncOperation)); } var awaiter = new ResourceRequestConfiguredAwaiter(asyncOperation, progress, cancellation); PlayerLoopHelper.AddAction(timing, awaiter); return(new UniTask <UnityEngine.Object>(awaiter)); }
public static UniTask <Object> ConfigureAwait(this ResourceRequest resourceRequest, IProgress <float> progress = null, PlayerLoopTiming timing = PlayerLoopTiming.Update, CancellationToken cancellation = default) { Error.ThrowArgumentNullException(resourceRequest, nameof(resourceRequest)); var awaiter = new ResourceRequestConfiguredAwaiter(resourceRequest, progress, cancellation); if (!awaiter.IsCompleted) { PlayerLoopHelper.AddAction(timing, awaiter); } return(new UniTask <Object>(awaiter)); }