What problem does it solve?
UniTask solves unreliable or unsafe asynchronous flows in Unity by providing proper cancellation and PlayerLoop-integrated await support, so work stops cleanly when objects are destroyed.
Core Features & Use Cases
- Zero-allocation async/await: reduces GC pressure compared to typical async patterns in Unity.
- First-class cancellation support: requires passing CancellationToken to prevent MissingReferenceException and undefined behavior.
- PlayerLoop timing control: await specific Unity loop phases (Update, FixedUpdate, initialization/post-late-update) and frame boundaries.
- Async-friendly Unity APIs: wrap SceneManager, Resources, UnityWebRequest, and Addressables operations with ToUniTask.
- Common workflow patterns: implement bootstrapping chains, async loops, timeouts, debouncing, and fire-and-forget with error handling.
Quick Start
Replace coroutine-based sequences with UniTask methods that accept a CancellationToken and await Unity operations via ToUniTask for cancellation-safe behavior.