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