A State Machine for Unity3D