public bool ChangeState(string newState)
        {
            if (newState == currentState.StateName)
            {
                //Debug.Log("Origin State:" + newState);
                return(true);
            }

            foreach (AIStateNode state in StateMap)
            {
                if (state.StateName == newState)
                {
                    //Debug.Log("Enter New State:" + newState);
                    currentState.OnStateExit();
                    currentState = state;
                    currentState.OnStateEnter();
                    return(true);
                }
            }

            Debug.LogErrorFormat("State Name {0} Not Found", newState);

            return(false);
        }
 public void Init()
 {
     InitStateMap();
     currentState = GetEntryState();
     currentState.OnStateEnter();
 }