MuharremTozan/Agentic-Duel / .agent/skills/unity-fsm
unity-fsm
VerifiedSpecialized skill for implementing a robust, extensible Finite State Machine in Unity using the State and Strategy patterns. Based on the pattern by Adam Myhre (3D Platformer). Use when creating complex AI, player controllers, or any system requiring structured state management.
Unity Finite State Machine (FSM)
This skill provides a modular, object-oriented State Machine architecture for Unity, specifically refactored to match the implementation in Adam Myhre's 3D Platformer.
Core Features
- Object-Oriented: Each state is a dedicated class.
- Hybrid Support: Support for both "Heavy" (classes) and "Light" (
ActionState) states. - Strategy-Based Transitions: Uses Predicates and Detection Strategies.
- Timer System: Includes Adam Myhre's
CountdownTimerandStopwatchTimer. - Namespace Support: Uses
PlatformerandUtilitiesnamespaces.
Core Files (assets/code/)
IState.cs.txt,StateMachine.cs.txt,IPredicate.cs.txt: Base FSM logic.ActionState.cs.txt: New! Lambda-based state to reduce boilerplate.Timer.cs.txt: AI cooldown management.IDetectionStrategy.cs.txt,ConeDetectionStrategy.cs.txt: Sensing logic.PlayerDetector.cs.txt,Enemy.cs.txt,EnemyBaseState.cs.txt: AI templates.
Usage Guides
- GUIDE.md: General FSM setup and wiring.
- ENEMY-AI.md: Specific guide for implementing AI with Detection Strategies.
Implementation Pattern
- Define your states by inheriting from
BaseState. - Wire them in your
PlayerControllerorEnemyAIusingstateMachine.AddTransition. - Execute via
Update()andFixedUpdate()calls to the machine.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |