View on Asset Store (opens in new tab)
Package details
- Latest version
- 1.0
- Last updated
- First released
- Unity version
- 2022.3.62 or later
- Package size
- 148 KB
- Files
- 20
- Favorites
- 1
- Views in the past week
- 5
Price tracking
- Last checked
- Tracked since
- Lowest recorded
- $4.99 on
Keywords
Code-First FSM
A clean, code-first Hierarchical State Machine (HFSM) framework. Features nested states, event triggers, history tracking, and a real-time Visual Debugger for pure C# logic.
Affiliate link · Purchases support this site
Price history
Last 6 months
USDAsset preview
1 / 5
Code-First FSM screenshot 1
About this asset
Stop writing "Boolean Hell" in your Update loops.
Code-First FSM is a professional architecture solution designed to help you write cleaner, maintainable game logic. Unlike visual node editors that clutter your project, this is a strictly typed, code-centric framework for intermediate and advanced developers who want full control.
Why Code-First?Visual graphs are great for designers, but for programmers, they can be slow to refactor. This framework lets you define States as pure C# classes, allowing for proper inheritance, interfaces, and unit testing.
Key Features:
- Hierarchical State Machines (HFSM): Nest machines inside other states to create complex AI (e.g., a "Grounded" state that internally handles "Idle/Walk/Run").
- Visual Debugger: Includes a custom Editor Window that uses Reflection to see exactly what state your objects are in at runtime—even private logic!
- Event Triggers: Support for Input.GetKeyDown or animation events via fsm.Trigger("Jump").
- History & Undo: Built-in support to revert to the PreviousState.
- Zero Boilerplate: Use ActionState to prototype logic in a single lambda function without creating new files.
Includes:
- Full C# Source Code (Assembly Defs included).
- Two Demo Scenes: Simple Cube (Basics) and Capsule Hero (Advanced HFSM).
- Comprehensive PDF Documentation.
From the publisher's Asset Store listing.
Technical details
- Architecture: Pure C# Classes (Non-MonoBehaviour states).
- Namespace: AlkirenGames.FSM
- Pipelines: Supports Built-in, URP, and HDRP.
- Platforms: Windows, Mac, Linux, iOS, Android, WebGL, Console.
- Tools: Includes "FSM Debugger" Editor Window.
- Dependencies: None (No 3rd party DLLs).
- Assembly Definitions: Included for faster compilation.
Compatibility
| Unity version | Built-in | URP | HDRP |
|---|---|---|---|
| 2022.3.62f2 | Compatible | Compatible | Compatible |
This is a C# logic-only framework. It is compatible with all Render Pipelines (Built-in, URP, HDRP) and all supported platforms (PC, Mobile, Console, WebGL).
As listed on the Asset Store.