public void GotoState(string name)
 {
     GotoState(states.GetStateIndex(name));
 }