[RELEASED]Finite State Machine

Hello Unity enthusiasts! I am happy to present this asset:

https://www.assetstore.unity3d.com/en/#!/content/49940

An instance of this class creates a finite state machine that manages triggers, callbacks and debugging messages.

By using states and events a matrix is created internally, so certain events change a state to another.

Methods can be set to be called when a state starts, while it is running and when the state goes away.

The fsm can be given a name and debug messages will use it. The fsm can be set to print messages when an event is handled and when an event changes the current state.

A callback can be passed to the fsm and it will be called when the state changes, returning the new state key.

This is not a monobehaviour so cannot be attached to Game Objects. But it can be used inside any C# code.

https://googledrive.com/host/0BwLxu4JZ_YzdQWJOaF9peHVSeTg/Web.html Web Demo

1 Like

Version 1.1 is up!
Changes:

  • Moved delegated and related classes as nested.
  • Added namespaces to example and asset class.
  • Modified instructions pdf accordingly.

I hope you can find value in this asset. I use it in all my works. =)