unity-patterns

Recommends Unity design patterns for decoupled game architecture decisions.

Updated Aug 18, 2026
One-click install
npx skills add https://github.com/ethanJPope/Our-Main-Hackathon-Game --skill unity-patterns-ethanjpope
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-patterns
Source: https://github.com/ethanJPope/Our-Main-Hackathon-Game/tree/main/.agents/skills/unity-skills/skills/patterns
Command: npx skills add https://github.com/ethanJPope/Our-Main-Hackathon-Game --skill unity-patterns-ethanjpope

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Choosing the right design pattern in Unity is hard: overusing event buses, singletons, or interfaces leads to hidden coupling and debugging pain, while under-engineering leaves systems brittle. This Skill helps you decide whether a pattern is justified and which of 1-3 candidates actually fits your problem. ## Core Features & Use Cases - Pattern Selection Guide: Covers ScriptableObjects, C# events/delegates, event buses, interfaces, state machines, object pools, service layers, and generics, each with explicit use/avoid criteria. - Decision Lab: Compares 2-3 plausible implementations side by side on switch cost, per-frame cost, code complexity, and failure modes, with a worked example of pausing AI on 100 enemies. - Guardrails: Recommends at most 1-3 patterns and forces justification of why simpler alternatives are insufficient. - Use Case: You are building a cutscene system that must freeze 500 enemies. Use this Skill to compare a field flag, disabling MonoBehaviours, and a subset-list approach, then pick the one whose cost profile matches your scale. ## Quick Start Ask the AI which Unity pattern fits your problem, for example whether to use an event bus or C# events for decoupling your UI from gameplay systems.

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 for my Unity project?

Compare at most 1-3 candidate patterns against your actual problem scale and constraints. Justify why simpler options like a boolean flag or direct reference are insufficient before adopting event buses, state machines, or service layers.

When should I use ScriptableObjects in Unity?

Use ScriptableObjects for authored configuration, shared static data, event channels, and reusable data assets. Avoid them as the default home for per-run mutable gameplay state, where plain class instances are clearer.

Should I use a global event bus or C# events in Unity?

Prefer C# events and delegates for one-to-many notifications with clear ownership and unsubscribe points. Reserve a global event bus for cases where many systems genuinely need broad decoupled notifications, since it hides ownership and complicates debugging.

When is an object pool worth it in Unity?

Use object pooling for frequent spawn and despawn cycles such as bullets, VFX, enemies, or UI items. Skip pooling for rarely created objects or when lifetime management is simple, since the added complexity is not justified.

What are the trade-offs of disabling MonoBehaviours to pause game logic?

Setting enabled = false gives zero per-frame cost because Unity skips disabled Behaviours, but OnDisable and OnEnable side effects can stop coroutines and unsubscribe listeners unexpectedly. A field flag is simpler but costs a branch test per frame per entity.