public bool ChangeState(string key) { FiniteStateMachineNode retval; if (_states.TryGetValue(key, out retval)) { _currentState.OnExit(); _currentState = retval; _currentState.OnEnter(); return(true); } return(false); }
public bool Start(string key) { FiniteStateMachineNode retval; if (_states.TryGetValue(key, out retval)) { _currentState = retval; isRunning = true; return(true); } Debug.LogError("WARNING - " + key + " does not exsist! Cannot start the StateMachine!"); return(false); }
public bool Add(FiniteStateMachineNode state, string key) { FiniteStateMachineNode retval; if (_states.TryGetValue(key, out retval)) { return(false); } else { _states.Add(key, state); return(true); } }