unity-async

Recommends Unity async scheduling strategies among Update, coroutines, UniTask, and timers.

Updated Jan 29, 2026
One-click install
npx skills add https://github.com/Dylan8865/FinalYearProject --skill unity-async-dylan8865
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: unity-async
Source: https://github.com/Dylan8865/FinalYearProject/tree/main/GameDev/Tester/.agents/skills/unity-skills/skills/async
Command: npx skills add https://github.com/Dylan8865/FinalYearProject --skill unity-async-dylan8865

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unity developers often struggle to choose the right async and lifecycle model, overusing Update loops or adopting UniTask without justification, leading to messy lifecycle management and cancellation bugs. ## Core Features & Use Cases - Decision Ladder: Guides you through whether per-frame work is needed at all, then toward events, coroutines, or UniTask based on project context. - Lifecycle Ownership Guidance: Defines who starts, cancels, and cleans up async work using OnEnable/OnDisable/OnDestroy symmetry and IDisposable where appropriate. - Use Case: When a developer asks whether to use a coroutine or UniTask for a timed ability cooldown, the skill recommends the simplest fitting model, identifies the cancellation owner, and flags hot-path risks. ## Quick Start Ask the assistant whether you should use a coroutine or UniTask for your Unity timer and how to handle its cleanup.

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 it is not inherently better for simple cases.

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 scattered 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 ad-hoc cleanup.

When is IDisposable appropriate in Unity code?▼

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

What are the performance risks of Unity async patterns?▼

Hot-path risks include many unrelated Update methods and uncached references in frequently executed code. Cache references used in hot paths and prefer event-driven flows over polling where possible.