Cysharp/UniTask
54.0
Adequate · 22 September 2026
29.5k
lines of production code
C#
primary language
5
measurements over time
What this system is
UniTask is a high-performance asynchronous task library for C\# and Unity, designed to replace or augment the standard Task/async-await model with zero-allocation, frame-aware execution. It provides a comprehensive suite of async primitives, reactive properties, and LINQ-style operators for handling asynchronous data streams. The system integrates deeply with the Unity engine, offering async wrappers for MonoBehaviour lifecycle events, UI components, and external libraries like DOTween and Addressables. Additionally, it supports modern .NET Core development with a dedicated analyzer to enforce best practices.
Features
Add .NET Core sandbox project for UniTask
A new .NET Core sandbox project (src/UniTask.NetCoreSandbox) has been added to the repository. This includes a Program.cs file that demonstrates the usage of UniTask within a .NET Core environment, specifically showing how to handle cancellation tokens and async/await patterns. This serves as a testbed or example for using UniTask in modern .NET applications.
src/UniTask.NetCoreSandbox · high confidence
Add UniTask extensions for Unity Addressables with cancellation and auto-release support
The Addressables async extensions are now available as a separate assembly (UniTask.Addressables), enabling the use of UniTask with Unity's Addressables system. The new \ToUniTask\ and \WithCancellation\ methods allow awaiting Addressable operations with full \CancellationToken\ support, including the ability to immediately cancel the operation and automatically release the handle when cancelled.
src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables · high confidence
Add UniTask integration for DOTween
Introduces new async extension methods for DOTween, including \AwaitForComplete\, \AwaitForPause\, \AwaitForPlay\, \AwaitForRewind\, and \AwaitForStepComplete\, allowing developers to await DOTween tweens using C\# \await\ syntax. The change also adds a \WithCancellation\ method to support task cancellation and includes an assembly definition (\UniTask.DOTween.asmdef\) to manage dependencies on the DOTween library.
src/UniTask/Assets/Plugins/UniTask/Runtime/External/DOTween · high confidence
Add async support for TextMeshPro InputField events and TMP Text binding
Developers can now use UniTask to asynchronously handle TextMeshPro InputField events (such as value changes, end-of-edit, text selection, and submit) via new extension methods like OnValueChangedAsync and OnEndEditAsync. Additionally, the library now supports binding async enumerables and reactive properties directly to TMP\_Text components for automatic UI updates.
src/UniTask/Assets/Plugins/UniTask/Runtime/External/TextMeshPro · high confidence
Add experimental UniTask analyzer to enforce CancellationToken usage
An experimental Roslyn analyzer (UniTaskAnalyzer) has been added to the UniTask.Analyzer project. It introduces a new diagnostic rule (UNITASK001) that flags invocations where a default value is passed for a CancellationToken parameter, ensuring that callers explicitly provide a cancellation token or use CancellationToken.None.
src/UniTask.Analyzer · medium confidence
Added Unity project settings for UniTask
Added a complete set of Unity project configuration files (including AudioManager, EditorBuildSettings, GraphicsSettings, InputManager, PlayerSettings, QualitySettings, and others) to the UniTask project. These settings define the environment for the project, including target Unity version (2022.3.39f1), build configurations, and rendering/physics parameters.
src/UniTask/ProjectSettings · high confidence
Added editor tools and test scenes for UniTask
Added editor scripts (EditorRunnerChecker, PackageExporter) and Unity scene files (ExceptionExamples, MiddlewareSample, SandboxMain, WaitWhileTest) to support testing and package management, alongside new C\# scripts for testing async operations and coroutines.
src/UniTask/Assets · high confidence
Adds async wrappers for standard Unity MonoBehaviour lifecycle events
The library now provides asynchronous versions of common Unity lifecycle events, allowing code to await specific moments in a component's life. New trigger components and extension methods are introduced for Awake, Start, and Destroy, enabling patterns like \await gameObject.AwakeAsync()\ or \await gameObject.OnDestroyAsync()\. Additionally, a T4 template (\MonoBehaviourMessagesTriggers.tt\) is added to generate async wrappers for a wide range of MonoBehaviour messages, including Update, FixedUpdate, LateUpdate, collision events, trigger events, and uGUI events. This expands the range of Unity events that can be awaited directly in async methods.
src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers · high confidence
Adds new LINQ operators to UniTask
The UniTask library adds several new LINQ operators to the \IUniTaskAsyncEnumerable\ interface, including \Aggregate\, \All\, \Any\, \Append\, \Prepend\, \AsUniTaskAsyncEnumerable\, \Average\, and \Buffer\. These additions provide new ways to aggregate, filter, and transform asynchronous data streams.
src/UniTask/Assets/Plugins/UniTask/Runtime/Linq · high confidence
New LINQ-style async enumerables for Unity frame and value change monitoring
Added new UniTask async enumerable operators to the Linq/UnityExtensions directory: EveryUpdate and EveryValueChanged for observing Unity update cycles and property changes, plus Timer and Interval for time-based and frame-count-based periodic events. These introduce a new pattern for handling Unity lifecycle events and property monitoring via the UniTask async enumerable API.
src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions · high confidence
New UniTask Tracker Editor Window
The UniTask library now includes a dedicated editor window for monitoring active tasks. This new feature adds a 'Window/UniTask Tracker' menu item that opens a split-pane interface: the left pane displays a sortable, multi-column table of tracked tasks (showing type, elapsed time, status, and position), while the right pane shows detailed stack traces. Users can enable or disable tracking, stack traces, and auto-reload directly from the window's header controls, and manually trigger garbage collection or reloads.
src/UniTask/Assets/Plugins/UniTask/Editor · high confidence
New async enumeration and task execution utilities for .NET Core
Added extension methods to convert between standard .NET IAsyncEnumerable and UniTask's IUniTaskAsyncEnumerable, enabling interoperability with modern C\# async iteration patterns. Additionally, introduced a new UniTask.Run method that executes actions or functions on the ThreadPool while respecting the current SynchronizationContext, and implemented a zero-allocation UniTask.Yield that reuses pooled delegates for continuations.
src/UniTask.NetCore · medium confidence
New async primitives and reactive properties
The library introduces several new types to support asynchronous patterns in Unity. This includes \AsyncLazy\ for lazy initialization of async operations, \AsyncReactiveProperty\ for async-aware reactive state management, and \Channel\ for async message passing between tasks. Additionally, \CancellationTokenExtensions\ provides utilities to convert \UniTask\ instances to \CancellationToken\ and vice versa, while \EnumeratorAsyncExtensions\ allows enumerators to be awaited or converted to \UniTask\ for seamless integration with Unity's coroutine system.
src/UniTask/Assets/Plugins/UniTask/Runtime · high confidence
Project structure and documentation overhaul
The repository has been restructured with new build configuration files (.editorconfig, Directory.Build.props) and a solution file (UniTask.NetCore.sln) to support .NET Core and MSBuild-based builds. Documentation has been significantly expanded, including a new Chinese README (README\_CN.md) and an updated English README (README.md) with comprehensive examples and a table of contents. The project also added a LICENSE file and updated the .gitignore to better handle Unity and Visual Studio generated files.
(repo-wide) · high confidence
Behavioural changes
Internal refactoring of UniTask runtime core
The internal runtime components have been restructured to improve performance and stability. A new ArrayPool and ArrayPoolUtil have been added to optimize array allocation and reuse, while the ContinuationQueue and PlayerLoopRunner have been refactored to use optimized queues and lock-free patterns. Additionally, a TaskPool system has been introduced to manage pooled delegates and state tuples, reducing garbage collection pressure. These changes enhance the underlying execution model for async operations within Unity.
src/UniTask/Assets/Plugins/UniTask/Runtime/Internal · high confidence
Refactored async state machine runners and method builders
The async state machine execution logic has been refactored into new \StateMachineRunner\ and \AsyncMethodBuilder\ classes. This change introduces a task pool system to manage state machine instances, reducing heap allocations and improving performance. The \MoveNextRunner\ has been renamed to \StateMachineRunner\, and the implementation now supports zero-allocation pooling in release builds, with specific workarounds for IL2CPP bugs.
src/UniTask/Assets/Plugins/UniTask/Runtime/CompilerServices · medium confidence
Restructured UniTask plugin directory layout
The UniTask plugin directory has been reorganized to improve project structure. New metadata files have been added for the 'Editor', 'Runtime', and 'package.json' components, each with unique GUIDs to support Unity's asset management system.
src/UniTask/Assets/Plugins/UniTask · high confidence
Test coverage
Expanded LINQ operator and test coverage for UniTaskAsyncEnumerable; New tests for async utilities and reactive properties.
Dependencies
Add .NET Core project structure and Unity package manifest for UniTask
The repository now includes dedicated project files for .NET Core (targeting net6.0, net7.0, netstandard2.1, and netstandard2.0) and a corresponding sandbox and test project, enabling native .NET Core development and testing alongside the existing Unity integration. An analyzer project is also introduced to provide Roslyn-based code analysis. Additionally, a Unity package manifest (package.json) is added, defining the package as com.cysharp.unitask version 2.5.11 for Unity 2018.4 and later.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 54 → 54 (-0.5)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 76 → 75 (-0.5)
- Architecture 100 → 100 (+0.0)
- Maturity 51 → 51 (+0.0)
- Readiness 74 → 64 (-10.6)
- Security 57 → 60 (+3.6)
- Performance 48 → 48 (-0.3)
Resolved (119)
- Analyzed solution does not cover the bulk of the repository
- BarePragmaDisable (src/UniTask.Analyzer/UniTaskAnalyzer.cs)
- BarePragmaDisable (src/UniTask.NetCore/NetCore/AsyncEnumerableExtensions.cs)
- BarePragmaDisable (src/UniTask.NetCoreSandbox/Program.cs)
- BarePragmaDisable (src/UniTask.NetCoreTests/Linq/CreateTest.cs)
- BarePragmaDisable (src/UniTask.NetCoreTests/Linq/CreateTest.cs)
- BarePragmaDisable (src/UniTask.NetCoreTests/Linq/Merge.cs)
- BarePragmaDisable (src/UniTask.NetCoreTests/TaskBuilderCases.cs)
- BarePragmaDisable (src/UniTask.NetCoreTests/TaskExtensionsTest.cs)
- Bounded contexts not declared
- CommentedOutCode (src/UniTask.NetCore/NetCore/UniTask.Delay.cs)
- CommentedOutCode (src/UniTask.NetCore/NetCore/UniTask.Delay.cs)
- CommentedOutCode (src/UniTask.NetCore/NetCore/UniTask.Delay.cs)
- Duplicated block (12 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs)
- Duplicated block (15 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs)
- Duplicated block (16 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs)
- Duplicated block (16 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs)
- Duplicated block (17 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/AsyncLazy.cs)
- Duplicated block (17 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs)
- Duplicated block (17 lines × 3) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Where.cs)
- …and 99 more
New (193)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs)
- Duplicated block (11 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs)
- Duplicated block (11 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs)
- Duplicated block (11 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs)
- Duplicated block (13 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs)
- Duplicated block (13 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupJoin.cs)
- Duplicated block (13 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipLast.cs)
- Duplicated block (13 lines × 6) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToArray.cs)
- Duplicated block (14 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Join.cs)
- Duplicated block (14 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SelectMany.cs)
- Duplicated block (14 lines × 3) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ToLookup.cs)
- Duplicated block (14 lines × 6) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/GroupBy.cs)
- Duplicated block (14–16 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipUntilCanceled.cs)
- Duplicated block (15 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/SkipUntil.cs)
- Duplicated block (16 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Except.cs)
- Duplicated block (16 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Zip.cs)
- Duplicated block (16 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/UniTask.WhenAll.cs)
- Duplicated block (17 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/Aggregate.cs)
- …and 173 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Cysharp/UniTask was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 22 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit ceac8d6946b1125fe782cd171fbcb245b567dbf9 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-0849c4f988a8.