A hierarchical finite state machine for Unity3D.