A hierarchical finite state machine on Unity3D.