unity-async

Guides selection among Update, coroutines, UniTask, and timers for Unity async scheduling.

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-async-du-qwq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-async
Source: https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications/tree/main/.agents/skills/unity-skills/skills/async
Command: npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-async-du-qwq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unity developers often struggle to choose the right async and lifecycle strategy, overusing Update loops or adopting UniTask without justification, leading to messy lifecycle management and cancellation bugs. ## Core Features & Use Cases - Decision Ladder: Walks through whether per-frame work is needed at all, then narrows to events, coroutines, UniTask, or Update based on the actual use case. - Lifecycle Ownership Guidance: Defines who starts, cancels, and cleans up async work, with subscribe-unsubscribe symmetry via OnEnable/OnDisable/OnDestroy. - Use Case: When a developer asks "should I use a coroutine or UniTask for this delay?", the skill evaluates project context and recommends the simplest fitting model with clear cancellation ownership. ## Quick Start Ask the skill how to write async code in Unity for your scenario, such as choosing between a coroutine and UniTask for a timed sequence.

Frequently Asked Questions about unity-async

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Should I use coroutines or UniTask in Unity?

Prefer coroutines for short Unity-bound sequences when the project does not already use UniTask. Choose UniTask only if the project already depends on it or you explicitly accept the dependency, since the simplest fitting model is preferred.

When should I use Update versus events in Unity?

Use Update only for true continuous simulation, polling, or input loops that cannot be event-driven. If the task does not need per-frame work, prefer events, callbacks, or explicit method calls to avoid many unrelated Update methods.

How do I handle cancellation and cleanup for async work in Unity?

Always define lifecycle ownership: who starts the work, who cancels it, and when it is cleaned up. In MonoBehaviour, use OnEnable, OnDisable, and OnDestroy for subscribe-unsubscribe symmetry rather than relying on IDisposable.

When is IDisposable appropriate in Unity projects?

Use IDisposable mainly for pure C# lifetimes, temporary subscriptions, or scope-based cleanup helpers. It should not be used as a cargo-cult replacement for Unity lifecycle methods like OnDisable or OnDestroy.

Why should I avoid adding UniTask to my Unity project?

UniTask should not be adopted just because it looks more advanced than coroutines. It adds a dependency that is only justified when the project already uses it or the team explicitly wants it and accepts the cost.