UniTask is a framework specifically developed for Unity. Like VContainer, it’s a system that preemptively solves potential issues we might encounter in Unity. It is not a new architecture or a newly discovered technology. It is simply the async structures that have been part of C# for years.
UniTask provides efficient, allocation-free async/await integration for Unity.
• UniTask and a custom AsyncMethodBuilder can be used to achieve zero-allocation.
• It makes all Unity AsyncOperations and Coroutines awaitable.
• It allows for PlayerLoop-based tasks that can replace all Coroutine operations (e.g., UniTask.Yield(), UniTask.Delay()).
• You can use MonoBehaviour message events and UI events asynchronously.
• It works entirely within Unity’s PlayerLoop, does not use extra threads, and runs smoothly on WebGL, wasm, Android, iOS, etc.
• It includes extra features like Async LINQ, Channel, and AsyncReactiveProperty.
• It has a TaskTracker extension to prevent memory leaks.
• It can work highly compatibly with Task/ValueTask/IValueTaskSource.
Please check it out:
https://github.com/Cysharp/UniTask
Reply by Email