What problem does it solve?
This Skill solves messy, hard-to-debug gameplay and AI logic caused by scattered conditional branches by providing a reusable finite state machine pattern.
Core Features & Use Cases
- Type-safe IState contracts: Define states with Enter/Exit plus Update and FixedUpdate for frame- and physics-timed behavior.
- Reusable generic StateMachine<T>: Register states once, transition by type, and reuse state instances to avoid per-transition allocations.
- Real-world state patterns: Use it for player states (idle/run/jump), high-level game flow (menu/loading/gameplay/pause), enemy AI (patrol/chase/attack), hierarchical FSMs, event-driven transitions, and ScriptableObject-driven configurable states.
- Testing-friendly design: States are plain C# classes that are easier to unit test without Unity dependencies.
Quick Start
Ask the AI to generate a Unity C# state machine setup for your game with an IState interface, a generic StateMachine<T>, and example transitions for player movement plus a pause/resume game flow.