Repository navigation
Ver.2.0.13
First stable release of UniTask v2.
It has many improvement and some breaking changes from v1.
New Features
- Almost all UniTask methods and
asyncmethod automatically reuse(zero allocation) and reduced heap allocation size - Asynchronous LINQ,
UniTaskAsyncEnumerablestandard factory and all linq operators and Unity specified factory generator - uGUI component has
***AsAsyncEnumerablethat converts event to async stream. - All async triggers(
Cysharp.Threading.Tasks.Triggers) implementsIUniTaskAsyncEnumerable<T> - Stacktrace in PlayerLoop shows current PlayerLoopTiming
- Available .NET Core package in NuGet
- Improved UniTaskTracker Window, enable a jump to the source file and TaskName displays generics type name
DOTweensupport in default(require tocom.demigiant.dotweenimport from OpenUPM or defineUNITASK_DOTWEEN_SUPPORT)Addressablesupport in default(AsyncOperationHandleandAsyncOpereationHandle<T>as awaitable)UniTaskCompletionSourcecan reuse by.Reset()- New last PlayerLoopTimings (
PlayerLoopTiming.LastPostLateUpdateis same asWaitForEndOfFrame) - New
AsyncReactiveProperty,AsyncReadOnlyReactiveProperty, that similar asReactivePropertyin UniRx - New
Channel.CreateSingleConsumerUnbounded, that is equivalent toSystem.Threading.Channels, similar as go channel - TaskPool to set/monitor pooling size by
TaskPool.SetMaxPoolSize,TaskPool.GetCacheSizeInfo
New Methods
- Add
UniTask.Preserve, it converts to allow multiple await - Add
UniTask.WaitUntilCanceled - Add
UniTask.Create - Add
UniTask.Defer - Add
UniTask.Action/UnityAction - Add
JobHandle.WaitAsync - Add
CancellationToken.WaitUntilCanceledextension method - Add
UnityEvent<T>andInputFieldAsyncEventHandler and extensions - Add
WithCancellationmethod to all async operation extensions
Changed from UniTask v1
- Namespace change:
UniRx.Async->Cysharp.Threading.Tasks - All
UniTask/UniTask<T>can not await twice(will throw exception), Reusable Promise is discontinuance - All UniTask Factory method(such as
UniTask.Delay) run immediately(same as standard Task, previously it does not run before call await) - All Trigger method combinates
GetAsync***TriggerandGet***AsyncHandlerand***Async. UniTask.LazyreturnsAsyncLazy<T>- UniTask accepts
IUniTaskSourceinstead ofIAwaiter UniTask.WhenAnyreturn type is changed to(int winArgumentIndex, T1 result1, T2 result2, ...)UniTask.WhenAll's tuple does not use specified nameUniTaskScheduler.UnobservedExceptionWriteLogType's default is changed toLogType.ExceptionUniTaskVoidcan not awaitIObservable<T>.ToUniTaskparameter order changed fromCancellationToken cancellationToken, bool useFirsttobool useFirst, CancellationToken cancellationTokenUniTask.VoidActionis renamed toUniTask.ActionUniTask.DelayFramereturn type is changed fromUniTask<int>toUniTaskUniTask.Void/Action/UnityActiontype is changed fromFunc<UniTask>toFunc<UniTaskVoid>- Removed
ConfigureAwaitmethod from all async operation extensions(renamed toToUniTask) - Removed
new UniTask(factory), useUniTask.CreateorUniTask.Lazyinstead - UnityWebRequest's AsyncOperation calls
UnityWebRequest.Abort()when detect canceled - JobHandle await extension does not accept
CancellationToken - Lower Unity support version is changed to
2018.4.13f1 - Modified directory structure, under
RuntimeandEdtiordirectory to follow standard UPM design