unity-patterns

Select Unity design patterns for gameplay and architecture problems.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/Rayzerrek/dotfiles --skill unity-patterns-rayzerrek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-patterns
Source: https://github.com/Rayzerrek/dotfiles/tree/main/.pi/agent/skills/unity-skills/skills/patterns
Command: npx skills add https://github.com/Rayzerrek/dotfiles --skill unity-patterns-rayzerrek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you choose the right Unity architecture pattern when a feature could be built several ways, so you can avoid overengineering and keep systems understandable.

Core Features & Use Cases

  • Pattern selection: Compares common Unity approaches such as ScriptableObject, events, state machines, object pooling, observers, interfaces, and service layers.
  • Decision support: Explains when a pattern fits, when a simpler option is enough, and what tradeoffs you accept by choosing it.
  • Practical scenarios: Useful for questions like whether to use a state machine for actor behavior, an event system for decoupled notifications, or a pool for frequently spawned objects.

Quick Start

Ask for the best Unity pattern for your problem and include the gameplay goal, constraints, and what alternatives you are considering.

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 Unity design pattern for my gameplay architecture?

Use a Unity state machine for actor behavior when an object has distinct modes with complex transitions. For simple actors, a state machine may overengineer the problem, making simpler alternatives more suitable for your architecture.

When do I need a state machine for Unity actor behavior?

Use a Unity state machine for actor behavior when an object has distinct modes with complex transitions. For simple actors, a state machine may overengineer the problem, making simpler alternatives more suitable for your architecture.

What is the best way to decouple Unity systems with an event system?

Use a Unity object pool for frequently spawned objects like projectiles or particles. Pooling reuses instances instead of instantiating and destroying them, minimizing garbage collection overhead and improving runtime performance.

Should I use ScriptableObject data or a service layer for Unity architecture?

Choose ScriptableObject data for decoupled, inspector-configurable static information, and a service layer for shared runtime logic. Comparing these Unity architecture options helps evaluate tradeoffs and minimal implementation boundaries for your specific feature.

When should I avoid object pooling in Unity?

Avoid Unity object pooling for rarely spawned objects or when memory footprint is critical. Evaluating these tradeoffs ensures the selected pattern fits the problem without overengineering, keeping the decoupled systems understandable and efficient.