asynchronous-programming

Implement non-blocking async patterns for Unity main thread operations.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/Criezzz/Gametopia2026 --skill asynchronous-programming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: asynchronous-programming
Source: https://github.com/Criezzz/Gametopia2026/tree/main/.agent/skills/asynchronous-programming
Command: npx skills add https://github.com/Criezzz/Gametopia2026 --skill asynchronous-programming

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill helps Unity developers avoid freezing the main thread by providing patterns and utilities for non-blocking scene loads, asset loading, network requests, and file I/O operations.

Core Features & Use Cases

  • Coroutines, async/await, and UniTask: guidance on when to use each approach and trade-offs for allocations and main-thread safety.
  • Cancellation and lifecycle safety: CancellationToken patterns, DestroyCancellationToken in AsyncMonoBehaviour, and safe RunAsync helpers to prevent leaked tasks.
  • Utilities and templates: ready-made AsyncLoader, AsyncMonoBehaviour, AsyncOperation, CoroutineToTask utilities and a generator script to scaffold components.
  • Use Cases: sequential and parallel asset loading, scene loading with progress reporting, network requests with timeouts, bridging legacy coroutines to awaitable Tasks or UniTask.

Quick Start

Use the asynchronous-programming skill to implement an awaitable scene load with progress reporting and cancellation in your Unity project.

Frequently Asked Questions about asynchronous-programming

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

FAQPage Schema
How do I prevent blocking the Unity main thread during scene loads and asset loading?

To prevent blocking the Unity main thread, apply non-blocking async patterns using C# async/await, UniTask, or coroutines for scene and asset loading operations. This skill provides ready-made AsyncLoader utilities to execute long-running tasks safely without freezing the main thread.

What is the best way to handle async network requests and file I/O in Unity without freezing?

The best way to handle async network requests and file I/O in Unity is using UniTask or async/await with CancellationToken patterns. This skill provides templates for network requests with timeouts and file operations that ensure main-thread safety throughout the execution.

How do I use CancellationToken with async tasks in Unity to prevent leaked tasks?

To use CancellationToken with async tasks in Unity and prevent leaked tasks, apply DestroyCancellationToken in AsyncMonoBehaviour and safe RunAsync helpers. This skill provides cancellation patterns that ensure tasks are properly cancelled when GameObjects are destroyed during scene transitions.

Coroutines vs UniTask vs async/await in Unity: which approach should I use for non-blocking operations?

Choosing between coroutines, UniTask, and async/await in Unity depends on your allocation tolerance and main-thread safety needs. This skill provides guidance on trade-offs for each approach, helping you select the right pattern for sequential or parallel async tasks.

How do I bridge legacy coroutines to awaitable Tasks or UniTask in Unity?

To bridge legacy coroutines to awaitable Tasks or UniTask in Unity, use CoroutineToTask utilities provided by this skill. These helpers convert existing coroutine implementations into awaitable operations while maintaining main-thread safety and cancellation support.

How do I report progress during awaitable scene loading in Unity?

To report progress during awaitable scene loading in Unity, apply AsyncOperation utilities with progress reporting and cancellation tokens. This skill provides templates for sequential and parallel asset loading that report progress while ensuring the main thread remains responsive.