tools-unity-state-machine

Build asynchronous Unity state machines with IState contracts and navigation controllers.

6|1|Updated Feb 6, 2026
One-click install
npx skills add https://github.com/tjboudreaux/cc-plugin-unity-gamedev --skill tools-unity-state-machine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tools-unity-state-machine
Source: https://github.com/tjboudreaux/cc-plugin-unity-gamedev/tree/main/skills/tools-unity-state-machine
Command: npx skills add https://github.com/tjboudreaux/cc-plugin-unity-gamedev --skill tools-unity-state-machine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

State machines manage game flow, UI navigation, and entity behavior in Unity, enabling safe, scalable transitions and cleanups.

Core Features & Use Cases

  • IState and IStateTransitionData contracts for typed state parameters
  • StateNavigationController for sequential and additive transitions
  • ActivityState pattern for modular, disposable states
  • HierarchicalStateMachine for nested states and smooth transitions
  • Guarded transitions and transition actions for robust flows
  • Safe disposal and cancellation handling to prevent leaks

Quick Start

Define IState and IStateTransitionData interfaces, implement a StateNavigationController to manage transitions, and wire concrete states to drive game flow and UI navigation.

Frequently Asked Questions about tools-unity-state-machine

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

FAQPage Schema
How do I build an asynchronous state machine in Unity for UI navigation?

Build an asynchronous Unity state machine by implementing IState and IStateTransitionData contracts, then using a StateNavigationController to drive safe sequential and additive UI transitions.

How do I manage hierarchical state transitions in Unity game flows?

Manage hierarchical state transitions in Unity using a HierarchicalStateMachine that supports nested states and smooth transitions across gameplay, menus, and loading screens.

What is the best way to prevent memory leaks during Unity state transitions?

Prevent memory leaks during Unity state transitions by using the ActivityState pattern for modular disposable states and enforcing safe disposal with cancellation support.

Can I use guarded transitions and transition actions for complex game flows?

Yes, you can use guarded transitions and transition actions to enforce robust flows, ensuring that complex scene state changes only occur when specific conditions are met.

Does this Unity state machine support typed parameters for entity AI transitions?

Yes, the Unity state machine supports typed parameters for entity AI transitions by enforcing IStateTransitionData contracts, ensuring safe data passing between states.