A finite state machine I wrote that is meant to be used with the Unity game engine.