Overview of UniTask
masterUniTask is a high-performance, zero-allocation async/await solution designed specifically for Unity. It utilizes value-type UniTask<T> and a custom AsyncMethodBuilder to eliminate heap allocations during asynchronous operations.
Key features include:
- Unity Integration: Makes all Unity
AsyncOperationsandCoroutinesawaitable. - Coroutine Replacement: Provides PlayerLoop-based tasks (e.g.,
UniTask.Yield,UniTask.Delay,UniTask.DelayFrame) that can replace standard coroutines. - Event Support: Provides awaitable/async extensions for
MonoBehaviourmessage events anduGUIevents. - Platform Compatibility: Runs entirely on Unity's
PlayerLoopwithout using threads, making it compatible with WebGL and WASM. - Async LINQ: Includes
ChannelandAsyncReactivePropertyfor asynchronous LINQ operations. - Memory Management: Includes a
TaskTrackerEditorWindow to track UniTask allocations and prevent memory leaks. - Standard Compatibility: Highly compatible with native
Task,ValueTask, andIValueTaskSource.