unity-patterns

Advises on selecting Unity design patterns for decoupled system architecture decisions.

Updated Oct 13, 2025
One-click install
npx skills add https://github.com/Darth-Carrotpie/ProxyCore --skill unity-patterns-darth-carrotpie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: unity-patterns
Source: https://github.com/Darth-Carrotpie/ProxyCore/tree/main/.agents/skills/unity-skills/skills/patterns
Command: npx skills add https://github.com/Darth-Carrotpie/ProxyCore --skill unity-patterns-darth-carrotpie

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Choosing the wrong design pattern in Unity leads to over-engineered code, hidden coupling, and hard-to-debug systems. This Skill helps you decide whether a pattern like ScriptableObject, an event bus, a state machine, or object pooling is actually justified for your problem. ## Core Features & Use Cases - Pattern Selection Guidance: Covers ScriptableObject, C# events/delegates, global event buses, interfaces, state machines, object pools, service layers, and generics/attributes, each with explicit use and avoid criteria. - Decision Lab Comparisons: Compares 2-3 plausible implementations side by side on switch cost, query cost, code complexity, and failure modes, with a worked example of pausing AI on 100 enemies. - Structured Recommendations: Outputs recommended patterns, why they fit, why simpler alternatives fall short, minimal implementation boundaries, and known tradeoffs. - Use Case: When building a cutscene system that must freeze 100 enemies, use this Skill to weigh a field flag, disabling MonoBehaviours, or a managed subset list before committing to an approach. ## Quick Start Ask the agent which Unity design pattern fits your problem, for example whether you should use a state machine or an event bus for your current system.

Frequently Asked Questions about unity-patterns

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

FAQPage Schema
How do I choose the right design pattern in Unity?▼

Compare the 2-3 plausible implementations side by side on switch cost, query cost, code complexity, and failure modes. Recommend at most 1-3 patterns and explain why simpler options are not enough for the problem.

When should I use a state machine in Unity?▼

Use a state machine for actors with mutually exclusive states and explicit transitions. Avoid it when a few booleans or a small command flow is enough to express the behavior.

Should I use a global event bus in Unity?▼

Use a global event bus sparingly and only when many systems truly need broad decoupled notifications. Avoid it as the default answer to coupling, since it often hides ownership and makes debugging harder.

When is object pooling worth it in Unity?▼

Use object pooling for frequent spawn and despawn of bullets, VFX, enemies, or UI items. Avoid it for rare objects or when object lifetime is simple, since the added complexity is not justified.

What are the downsides of disabling MonoBehaviours to pause enemies?▼

Disabling MonoBehaviours has zero per-frame cost but spreads state across components. OnDisable and OnEnable side effects, such as stopped coroutines and unsubscribed listeners, may fire unexpectedly.