Releases: Cysharp/UniTask
Ver.2.0.15
Important Note
Previous 2.0.x releases does not work correctly on IL2CPP release build under a specific condition.
This version is fixed it so be sure to use this.
Currently, a side effect of the fix is that one allocation may occur in IL2CPP builds.
- Fix unobserved exception shows error in UniTaskTracker window
- Fix
ToCoroutine
does not throws exception when error detected - Add
UniTask.NextFrame
- Add
UniTask.WaitForEndOfFrame
- Add
UniTask.WaitForFixedUpdate
- Breaking Changes:
WithCancellation
is returned from native timing of PlayerLoop - Breaking Changes:
UniTask.Delay/DelayFrame
,UniTaskAsyncEnumerable.Timer/Interval/TimerFrame/IntervalFrame
always skip initial frame
Ver.2.0.14
- Improve DOTween Extensions
- Add netstandard2.0 support to NuGet package
- Fix
UniTask.Defer
- Fix
UniTask.ReturnToCurrentSynchronizationContext
- Fix can not await struct IEnumerator
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
async
method automatically reuse(zero allocation) and reduced heap allocation size - Asynchronous LINQ,
UniTaskAsyncEnumerable
standard factory and all linq operators and Unity specified factory generator - uGUI component has
***AsAsyncEnumerable
that 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
DOTween
support in default(require tocom.demigiant.dotween
import from OpenUPM or defineUNITASK_DOTWEEN_SUPPORT
)Addressable
support in default(AsyncOperationHandle
andAsyncOpereationHandle<T>
as awaitable)UniTaskCompletionSource
can reuse by.Reset()
- New last PlayerLoopTimings (
PlayerLoopTiming.LastPostLateUpdate
is same asWaitForEndOfFrame
) - New
AsyncReactiveProperty
,AsyncReadOnlyReactiveProperty
, that similar asReactiveProperty
in 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.WaitUntilCanceled
extension method - Add
UnityEvent<T>
andInputField
AsyncEventHandler and extensions - Add
WithCancellation
method 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***Trigger
andGet***AsyncHandler
and***Async
. UniTask.Lazy
returnsAsyncLazy<T>
- UniTask accepts
IUniTaskSource
instead ofIAwaiter
UniTask.WhenAny
return 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.Exception
UniTaskVoid
can not awaitIObservable<T>.ToUniTask
parameter order changed fromCancellationToken cancellationToken, bool useFirst
tobool useFirst, CancellationToken cancellationToken
UniTask.VoidAction
is renamed toUniTask.Action
UniTask.DelayFrame
return type is changed fromUniTask<int>
toUniTask
UniTask.Void/Action/UnityAction
type is changed fromFunc<UniTask>
toFunc<UniTaskVoid>
- Removed
ConfigureAwait
method from all async operation extensions(renamed toToUniTask
) - Removed
new UniTask(factory)
, useUniTask.Create
orUniTask.Lazy
instead - 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
Runtime
andEdtior
directory to follow standard UPM design
Ver 2.0.12-rc9
This version is preview, if you want to use stable version, check 1.3.1.
2.0.x has many breaking changes, see 2.0.0-preview1 release notes.
Improvement
- All await AsyncOperations become zero allocation
- Reduced async/await heap allocation size
- Improved internal task pool system(reduce heap allocation size, more performant)
- TaskTracker's TaskName displays generics type name
- Add
TaskPool.SetMaxPoolSize
- Add
TaskPoolMonitor.GetCacheSizeInfo
(next rc or release, will be changed to TaskPool.GetCacheSizeInfo)
Ver 2.0.11-rc8
This version is preview, if you want to use stable version, check 1.3.1.
2.0.x has many breaking changes, see 2.0.0-preview1 release notes.
Improvement
- Add JobHandle.WaitAsync(CancellationToken)
- Fix channel's cancellationTokenRegistration does not handle correctly
- Fix in UnityEditor performance issue
- Fix: does not work zero-allocation mechanism in release build
- .NET Core - UniTask to ValueTask becomes zero overhead
- .NET Core - coreapp3.1's UniTask.Yield becomes zero allocation
- .NET Core - Add ValueTask.AsUniTask
Breaking Changes
- lower Unity support version is changed to
2019.1
UniTaskVoid
can not await.- UnityWebRequest's AsyncOperation calls
UnityWebRequest.Abort()
when detect canceled IObservable<T>.ToUniTask
parameter order changed fromCancellationToken cancellationToken, bool useFirst
tobool useFirst, CancellationToken cancellationToken
Ver 2.0.10-rc7
This version is preview, if you want to use stable version, check 1.3.1.
2.0.x has many breaking changes, see 2.0.0-preview1 release notes.
Improvement
- Add
WithCancellation
method to all async operation extensions - Improved all async operation extensions performance when async operation is done
- Add
DOTween
extensions (require tocom.demigiant.dotween
import from OpenUPM or defineUNITASK_DOTWEEN_SUPPORT
) - Fix
SuppressCancellationThrow
does not handle correctly when thrownOperationCanceledException
in async method - Fix
UniTaskAsyncEnumerable.CombineLatest
when source is immediately completed
Breaking Changes
- Remove
ConfigureAwait
method from all async operation extensions(renamed toToUniTask
) UniTask.VoidAction
is renamed toUniTask.Action
UniTask.VoidUnityAction
is renamed toUniTask.UnityAction
UniTask.Void/Action/UnityAction
type is changed fromFunc<UniTask>
toFunc<UniTaskVoid>
Ver 2.0.9-rc6
This version is preview, if you want to use stable version, check 1.3.1.
2.0.x has many breaking changes, see 2.0.0-preview1 release notes.
Improvement
- Add
UniTaskAsyncEnumerable.CombineLatest
- Add
UniTaskAsyncEnumerable.Pairwise
Breaking Changes
State<T>
is renamed toReadOnlyAsyncReactiveProperty<T>
and removed setter and implicit conversion.
Ver 2.0.8-rc5
This version is preview, if you want to use stable version, check 1.3.1.
2.0.x has many breaking changes, see 2.0.0-preview1 release notes.
Improvement
- Add new
State<T>
class, similar asReadOnlyReactiveProperty<T>
, no serializable, can create fromIUniTaskAsyncEnumerable
(or ToState extension method), can create from T implicit operator, can get setter byGetSetter
once. - Add
UnityEvent<T>
andInputField
AsyncEventHandler and extensions - Add UniTaskAsyncEnumerable.EveryValueChanged
- Impl AsyncReactiveProperty.ToString
Fix
- Fix UniTask.WaitUntilValueChanged does not handle UnityEngine.Object is destroyed correctly
Ver 2.0.7-rc4
This version is preview, if you want to use stable version, check 1.3.1.
2.0.x has many breaking changes, see 2.0.0-preview1 release notes.
Improvement
ForEachAsync(async _ => { })
becomes compile error- Add
IUniTaskAsyncEnumerable.Publish
- Add
CancellationToken.WaitUntilCanceled
extension method
Ver 2.0.6-rc3
This version is preview, if you want to use stable version, check 1.3.1.
2.0.x has many breaking changes, see 2.0.0-preview1 release notes.
Improvement
- Add UniTask.Defer
- Add UniTask.WaitUntilCanceled
- Add IUniTaskAsyncEnumerable.SkipUntilCanceled
- Add IUniTaskAsyncEnumerable.TakeUntilCanceled
- Fix ChannelReader.Completion throws UnobservedException when not touched
- Add IAsyncReadOnlyReactiveProperty.WithoutCurrent
- TaskTracker track Channel
- TaskTracker track All AsyncLINQ operators
Breaking Changes
- AsyncTrigger MoveNext returns false when destroyed
- AsyncReactiveProperty MoveNext returns false when called Dispose
- IAsyncReadOnlyReactiveProperty renamed to IReadOnlyAsyncReactiveProperty