/unity-plugin:unity-unitaskfrom unity-plugin
Expert in allocation-free async/await with UniTask for Unity: optimizing performance, migrating coroutines, and reducing GC pressure.
Ships in unity-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
UniTask is a zero-allocation async/await library optimized for Unity, providing allocation-free asynchronous programming patterns superior to standard C# Task.
Foundation Required: unity-csharp-fundamentals (TryGetComponent, FindAnyObjectByType), csharp-async-patterns (Task, async/await), unity-async (Unity async context)
Core Topics:
Learning Path: C# async basics → Unity async context → UniTask optimization → Production patterns
// Standard Task (allocates memory)
public async Task<int> GetStandard()
{
await Task.Delay(1000);
return 42;
}
// UniTask (zero allocation)
public async UniTask<int> GetOptimized()
{
await UniTask.Delay(1000);
return 42;
}
// Frame-based delays
await UniTask.Yield(); // Next frame
await UniTask.DelayFrame(10); // Wait 10 frames
await UniTask.NextFrame(); // Explicit next frame
// Time-based delays
await UniTask.Delay(TimeSpan.FromSeconds(1));
await UniTask.WaitForSeconds(1f);
// Unity operations
await Resources.LoadAsync<Sprite>("icon").ToUniTask();
await SceneManager.LoadSceneAsync("Level1").ToUniTask();
// Cancellation
CancellationTokenSource cts = new CancellationTokenSource();
await SomeOperation(cts.Token);
Core UniTask concepts and migration:
Advanced performance techniques:
Unity system integrations:
this.GetCancellationTokenOnDestroy() for MonoBehaviour lifecyclepublic class Example : MonoBehaviour
{
async UniTaskVoid Start()
{
// Auto-cancels when GameObject is destroyed
await LoadData(this.GetCancellationTokenOnDestroy());
}
}
// Execute multiple operations in parallel
(int result1, string result2, float result3) = await UniTask.WhenAll(
Operation1(),
Operation2(),
Operation3()
);
CancellationTokenSource cts = new CancellationTokenSource();
cts.CancelAfterSlim(TimeSpan.FromSeconds(5)); // PlayerLoop-based
try
{
await LongOperation(cts.Token);
}
catch (OperationCanceledException)
{
Debug.Log("Operation timed out");
}
this.GetCancellationTokenOnDestroy()UniTaskVoid for fire-and-forget operationsUniTask.Tracker in editorWhenAll/WhenAny for parallel executionSwitchToMainThread()/SwitchToThreadPool() appropriatelyWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
unitask, async, coroutine-replacement, performance, unity-async
npx claudepluginhub creator-hian/claude-code-plugins --plugin unity-plugin13 skills in this plugin
/unity-asyncHandle Unity's asynchronous programming patterns including coroutines, async/await, and Job System. Masters Unity's main thread restrictions and threading models. Use when guidance needed on Unity async operations, coroutine optimization, or parallel processing in Unity context./unity-collection-poolUnity Collection Pool expert for GC-free collection management using ListPool, DictionaryPool, HashSetPool, and ObjectPool. Masters memory optimization, pool sizing, and allocation-free patterns. Use PROACTIVELY for collection allocations, GC pressure reduction, temporary list/dictionary usage, or performance-critical code paths./unity-csharp-fundamentalsUnity C# fundamental patterns including TryGetComponent, SerializeField, RequireComponent, and safe coding practices. Essential patterns for robust Unity development. Use PROACTIVELY for any Unity C# code to ensure best practices./unity-mobileOptimize Unity games for mobile platforms with IL2CPP, platform-specific code, and memory management. Masters iOS/Android deployment, app size reduction, and battery optimization. Use for mobile builds, platform issues, or device-specific optimization./unity-networkingImplement multiplayer games with Unity Netcode, Mirror, or Photon. Masters client-server architecture, state synchronization, and lag compensation. Use for multiplayer features, networking issues, or real-time synchronization./unity-performanceOptimize Unity game performance through profiling, draw call reduction, and resource management. Masters batching, LOD, occlusion culling, and mobile optimization. Use for performance bottlenecks, frame rate issues, or optimization strategies.Other plugins' skills for the same job