Skip to content

About

Hierarchical State Machine for Unity, powered by Roslyn source generators — composable states, guarded transitions, pluggable controllers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Aspid.Core.HSM

Unity 6000.0+ Preview MIT

Warning

Work in progress. Aspid.Core.HSM is under active development. The public API is not yet stable and may change without notice between releases. Use with care in production.

Aspid.Core.HSM is a Roslyn-powered Hierarchical State Machine for Unity, built from small composable abstractions: states with Enter / Exit hooks, a parent→child hierarchy expressed through the generic IChildState<TParent> interface, pluggable per-frame controllers (IUpdateController, IFixedUpdateController, ILateUpdateController, …) aggregated via [ControllerGroup], declarative guarded transitions ([Transition]), extension states ([ExtensionFor]), state scopes and async enter/exit. MonoStateMachine wires it all to the Unity MonoBehaviour lifecycle.

Integration

Aspid.Core.HSM needs two packages installed: UniTask first, then the HSM itself. In the Package Manager click + → Install package from git URL… and paste each URL below.

1. UniTask

The async enter/exit controllers are built on UniTask, so the package does not compile without it.

https://github.com/Cysharp/UniTask.git?path=src/UniTask/Assets/Plugins/UniTask#2.5.11

Why this is a manual step. UPM does not resolve git dependencies transitively — a dependencies entry pointing at a git URL is simply ignored for anyone installing this package. Declaring UniTask in the manifest would therefore not install it, so it is installed explicitly instead. If you already get UniTask from the OpenUPM scoped registry, that installation works just as well; nothing here depends on how UniTask arrived.

2. Aspid.Core.HSM

The upm-preview branch always points to the latest preview release (alpha, beta, rc, …):

https://github.com/VPDPersonal/Aspid.Core.HSM.git#upm-preview

To pin a specific preview version, target the immutable per-release tag (see Releases for the list of available versions):

https://github.com/VPDPersonal/Aspid.Core.HSM.git#upm-preview/0.0.1-alpha.1

Note. There is no stable release yet, so the upm branch does not exist. The Release workflow creates it — along with upm/<version> tags and a #upm install URL — when the first non-prerelease version ships.

Game Loop sample

Import it from the package's Samples tab. Its scripts read input through the Input System, so install com.unity.inputsystem from the Unity Registry first, or the sample does not compile.

License

MIT.

About

Hierarchical State Machine for Unity, powered by Roslyn source generators — composable states, guarded transitions, pluggable controllers.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages