Skip to content
CAI
Software that uses CAICheck a score

Cysharp/UniTask

47.2

Weak · 11 November 2026

53.4k

lines of production code

C#

primary language

8

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a high-performance asynchronous programming library designed primarily for the Unity game engine, with recent expansions to support .NET Core environments. It provides a comprehensive suite of async primitives, reactive properties, and LINQ operators that integrate seamlessly with Unity's lifecycle events, Addressables, DOTween, and TextMeshPro. The library emphasizes zero-allocation performance through internal pooling mechanisms and includes tooling such as a Roslyn analyzer to enforce best practices in cancellation handling.

Features

Add TextMeshPro InputField and Text binding extensions

This update adds new async extension methods for TextMeshPro components, enabling developers to handle \TMP\_InputField\ events (such as value changes, end edit, text selection, and submit) as UniTasks or async enumerables. It also introduces \BindTo\ extensions that allow \TMP\_Text\ elements to automatically update their displayed text from async data sources. These features are conditionally compiled via the \UNITASK\_TEXTMESHPRO\_SUPPORT\ define, which is automatically enabled when the Unity TextMeshPro or UGUI packages are present.

src/UniTask/Assets/Plugins/UniTask/Runtime/External/TextMeshPro · high confidence

Add UniTask integration for DOTween with cancellation support

This change introduces a new assembly definition (UniTask.DOTween) and extension methods that allow DOTween Tweens to be awaited as UniTasks. Users can now use \await tween\ or \tween.ToUniTask()\ to wait for completion, with configurable cancellation behaviors (Kill, Complete, etc.) via \TweenCancelBehaviour\. Additionally, new methods \AwaitForComplete\, \AwaitForPause\, \AwaitForPlay\, \AwaitForRewind\, and \AwaitForStepComplete\ provide granular control over which tween events trigger the completion of the async operation. The implementation uses \CancellationToken.Register\ to ensure cancellation stops the tween and cleans up resources correctly.

src/UniTask/Assets/Plugins/UniTask/Runtime/External/DOTween · high confidence

Added .NET Core sandbox project for UniTask testing

A new .NET Core sandbox project (src/UniTask.NetCoreSandbox) has been added to facilitate testing and experimentation with UniTask features outside of Unity. The project includes a Program.cs file demonstrating basic async/await usage with UniTask, including cancellation token support and yield operations, serving as a local environment for validating library behavior on .NET Core.

src/UniTask.NetCoreSandbox · high confidence

Added Unity project configuration files for UniTask

The UniTask library now includes a complete set of Unity ProjectSettings files (such as AudioManager, PhysicsManager, PlayerSettings, and EditorSettings) within the src/UniTask directory. This addition establishes a default project configuration, setting the target Unity Editor version to 2022.3.39f1 and defining standard build settings, quality presets, and input mappings for the library's development environment.

src/UniTask/ProjectSettings · high confidence

Added experimental analyzer to enforce CancellationToken usage

An experimental Roslyn analyzer (UniTaskAnalyzer) has been added to the project, configured for local debugging via launchSettings.json. This analyzer introduces a new diagnostic rule (UNITASK001) that flags invocations where a CancellationToken argument is passed as the default value, requiring developers to explicitly pass a CancellationToken or CancellationToken.None to improve cancellation handling.

src/UniTask.Analyzer · high confidence

Expanded Async LINQ operators for UniTask

The \src/UniTask/Assets/Plugins/UniTask/Runtime/Linq\ directory now includes a comprehensive set of new asynchronous LINQ operators, adding capabilities such as \Aggregate\, \All\, \Any\, \Append\, \Prepend\, \Average\, and \Buffer\ to \UniTaskAsyncEnumerable\. These additions allow developers to perform complex data transformations, aggregations, and filtering on async streams directly within the UniTask ecosystem, extending the library's functional programming support.

src/UniTask/Assets/Plugins/UniTask/Runtime/Linq · high confidence

New .NET Core-specific async utilities and interop extensions

This update introduces several new capabilities for .NET Core and .NET Standard 2.1+ targets. It adds extension methods to convert between standard .NET \IAsyncEnumerable\<T\>\ and UniTask's \IUniTaskAsyncEnumerable\<T\>\, enabling seamless integration with modern async enumeration APIs. A new \UniTask.Run\ method is provided to execute actions or functions on the thread pool while optionally returning to the current \SynchronizationContext\. Additionally, \UniTask.Yield\ is implemented with a zero-allocation optimization for .NET Core 3.1+ using a task pool, and a \UniTask.Delay\ stub is added to the codebase.

src/UniTask.NetCore · high confidence

New Unity-specific async enumerable operators and timer timing adjustments

This update introduces three new LINQ-style async enumerable operators for Unity: \EveryUpdate\ (emits a value every frame), \EveryValueChanged\ (emits when a target object's property changes, supporting both Unity objects and standard classes with weak references), and \Timer\/\Interval\ (time- and frame-based periodic execution). All new operators support a \cancelImmediately\ flag for immediate cancellation handling and allow specifying the \PlayerLoopTiming\. Additionally, the \Timer\ implementation now skips the current frame during the initial due-time phase to prevent immediate emission upon subscription.

src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/UnityExtensions · high confidence

New async primitives and reactive property support

The runtime now includes AsyncLazy and AsyncLazy\<T\> for thread-safe, lazy initialization of async operations, and AsyncReactiveProperty\<T\> to expose reactive state as an async enumerable with WaitAsync support. CancellationToken utilities have been expanded with ToCancellationToken (linking task completion to cancellation), WaitUntilCanceled, and AddTo for automatic disposal, while Channel\<T\> provides a single-consumer unbounded async channel. EnumeratorAsyncExtensions now support awaiting IEnumerator directly and converting them to UniTask via MonoBehaviour.StartCoroutine, and IUniTaskSource gains ValueTask interoperability on .NET Core and Unity 2022.3+.

src/UniTask/Assets/Plugins/UniTask/Runtime · high confidence

New async triggers for Awake, Start, and OnDestroy lifecycle events

The Triggers directory now includes dedicated support for the Unity Awake, Start, and OnDestroy lifecycle events. New files AsyncAwakeTrigger.cs, AsyncStartTrigger.cs, and AsyncDestroyTrigger.cs provide extension methods (AwakeAsync, StartAsync, OnDestroyAsync) that allow developers to await these specific mono-behavior messages. The implementation uses a new AsyncTriggerBase infrastructure and an AwakeMonitor to handle cases where the trigger is added before the MonoBehaviour's Awake has fired, ensuring the async operation completes correctly even if the event has already occurred.

src/UniTask/Assets/Plugins/UniTask/Runtime/Triggers · high confidence

UniTask Addressables integration with cancellation and release handling

This change introduces the \UniTask.Addressables\ assembly definition and the \AddressablesAsyncExtensions\ class, enabling \AsyncOperationHandle\ to be awaited as a \UniTask\. It adds support for \CancellationToken\ via \WithCancellation\ and \ToUniTask\, including a new \autoReleaseWhenCanceled\ flag that automatically releases the Addressables handle when cancellation is requested. The implementation also handles edge cases such as immediate cancellation, invalid handles, and pre-completed operations with errors.

src/UniTask/Assets/Plugins/UniTask/Runtime/External/Addressables · high confidence

Architecture

Project structure modernized with EditorConfig and MSBuild props

The repository now includes an .editorconfig file to standardize code formatting (UTF-8, LF line endings, 2-space indentation for general files, 4-space for C\#) and disable specific Visual Studio diagnostics like unused private members. A new Directory.Build.props file centralizes MSBuild settings, enabling assembly signing with an open-source key and configuring NuGet package metadata (author, license, icon, and readme inclusion) for the UniTask packages.

(repo-wide) · high confidence

Behavioural changes

Editor tools updated for Unity 6.2+ compatibility and isolated assembly definition

The UniTask Editor package now includes a compatibility layer for Unity 6.2+, where the \TreeView\ API changed to require generic type parameters (\TreeView\<int\>\). To support this, a new \SplitterGUILayout\ helper was added to handle internal Unity reflection calls for the splitter UI, and the \UniTaskTrackerTreeView\ was updated to use the generic API. Additionally, an \UniTask.Editor.asmdef\ assembly definition file was introduced with \autoReferenced\ set to false, ensuring the editor tools are only loaded when explicitly needed rather than being automatically referenced by other assemblies.

src/UniTask/Assets/Plugins/UniTask/Editor · high confidence

Internal runtime infrastructure overhaul for performance and stability

The internal runtime components have been replaced with optimized implementations to reduce allocations and improve reliability. A new \ArrayPool\ and \ArrayPoolUtil\ provide pooled arrays for temporary buffers, while \PooledDelegate\ reuses delegate instances to avoid garbage collection pressure. The \ContinuationQueue\ and \PlayerLoopRunner\ have been rewritten to handle Unity's player loop timings more efficiently, including support for \TimeUpdate\ and \LastTimeUpdate\ in Unity 2020.2+. Additionally, \StatePool\ introduces pooled state tuples, \MinimumQueue\ offers a faster queue implementation, and \DiagnosticsExtensions\ enhances stack trace readability for debugging.

src/UniTask/Assets/Plugins/UniTask/Runtime/Internal · high confidence

Refactored async state machine execution and pooling

The internal compiler services for UniTask have been restructured to improve performance and stability. The previous 'MoveNextRunner' pattern has been replaced with a new 'StateMachineRunner' system that utilizes a task pool for reusing state machine instances, significantly reducing heap allocations. Additionally, the implementation now includes specific workarounds for IL2CPP VM bugs, ensuring that zero-allocation mechanisms function correctly in release builds and preventing application hang issues in Mono builds.

src/UniTask/Assets/Plugins/UniTask/Runtime/CompilerServices · high confidence

Restructured UniTask plugin directory layout

The UniTask plugin files have been reorganized within the Unity project structure. New metadata files (.meta) have been added for the Editor, Runtime, and package.json components, indicating a move to a more modular directory hierarchy under src/UniTask/Assets/Plugins/UniTask. This change affects how the plugin is imported and managed in the Unity Editor but does not alter the runtime behavior of the library itself.

src/UniTask/Assets/Plugins/UniTask · medium confidence

Test coverage

Added comprehensive LINQ tests for UniTaskAsyncEnumerable; Added editor tooling and test scaffolding for UniTask; New test coverage for .NET Core runtime behaviors.

Dependencies

Introduce .NET Core support and new build infrastructure

This change adds a new .NET Core build target (UniTask.NetCore) supporting .NET 6, .NET 7, and .NET Standard 2.0/2.1, enabling the library to be used outside of Unity. It also introduces a Roslyn analyzer project (UniTask.Analyzer) for compile-time checks, along with corresponding sandbox and test projects to validate the new .NET Core integration.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 48 → 47 (-0.8)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 75 → 73 (-2.6)
  • Architecture 100 → 73 (-27.3)
  • Maturity 39 → 43 (+3.7)
  • Readiness 53 → 54 (+0.3)
  • Security 61 → 52 (-8.3)
  • Performance 48 → 44 (-4.1)

Resolved (13)

  • Coverage not measured — no coverage collector is wired up
  • End-of-life runtime: .NET net7.0 (src/UniTask.NetCoreTests/UniTask.NetCoreTests.csproj)
  • Flaky test: UniTask.NetCoreTests::NetCoreTests.Linq.MergeTest.NetCoreTests.Linq.MergeTest.TwoSource
  • Inconsistent generic parameter naming in Defer. The stateless overloads use T for the result type (Defer<T>). The stateful overloads use TState for the state and TResult for the result (Defer<TState, TResult>). This is internally consistent but differs from Create where the stateless generic Create<T> uses T for the result, and the stateful Create<T> uses T for the state (and infers result or uses UniTask). Specifically, UniTask.Create<T>(T state, Func<T, UniTask> factory) uses T for state, while UniTask.Defer<TState>(TState state, ...) uses TState. This forces users to remember different generic parameter names for similar concepts across methods.
  • Inconsistent naming of the state parameter. In Run(Action<object> action, object state, ...), the parameter is named state. In Run<T>(Func<object, T> func, object state, ...), it is also named state. However, in UniTask.Create<T>(T state, Func<T, UniTask> factory), the parameter is also state. While consistent with itself, this differs from standard .NET Task.Run which uses state. This is actually consistent, but UniTask.Run mimics Task.Run while UniTask.Create mimics Task.Run's state parameter. The real issue is that UniTask.Run does not have a CancellationToken parameter, whereas UniTask.Create does. This is a feature gap, not a naming inconsistency.
  • Inconsistent parameter naming and structure for factory creation. The non-generic Create methods use factory as the parameter name, but the generic Create<T> method with state uses state as the first parameter and factory as the second. More importantly, UniTask.Create<T> (without state) takes only a factory, while UniTask.Create (without state) takes only a factory, but the overloads are split between static methods on UniTask and extension-like patterns in other libraries. Specifically, UniTask.Create<T>(Func<UniTask<T>> factory) lacks a CancellationToken overload in the same way UniTask.Create has one, creating a gap in parity for cancellation support in the generic void-returning factory case.
  • Low XML-doc coverage: UniTask.Analyzer (src/UniTask.Analyzer/UniTask.Analyzer.csproj)
  • Low XML-doc coverage: UniTask.NetCore(net6.0) (src/UniTask.NetCore/UniTask.NetCore.csproj)
  • Low XML-doc coverage: UniTask.NetCoreSandbox (src/UniTask.NetCoreSandbox/UniTask.NetCoreSandbox.csproj)
  • Scanner failed to run — not a clean result
  • Scanner failed to run — not a clean result
  • misleading comment (src/UniTask.NetCoreSandbox/Program.cs)
  • misleading comment (src/UniTask.NetCoreTests/Linq/Concat.cs)

New (164)

  • Duplicated block (10 lines × 14) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (10 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (11 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (11 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (11 lines × 8) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (11–12 lines × 12) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (12–13 lines × 12) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (12–13 lines × 8) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (17 lines × 12) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (19 lines × 13) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (20 lines × 11) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (20 lines × 6) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (22 lines × 12) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (22 lines × 4) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (22 lines × 8) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (30–31 lines × 11) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (30–31 lines × 2) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (30–31 lines × 5) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (30–31 lines × 8) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • Duplicated block (34–35 lines × 14) (src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/CombineLatest.cs)
  • …and 144 more

Written by cca.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 11 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit a77a1b4a89824fb6df293099de3060daf2a432c1 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.40+preprod-4d55ec1d7c69.