private void TransitionState() { foreach (StateTransition transition in currentState.transitions) { //should probably prioritize states with a value of some sort if (transition.CanTransition()) { currentState.Disable(); currentState = transition.nextState; currentState.Enable(); return; } } }
public void SetInitialState(NPC_BehaviorState behavior) { this.currentState = behavior; currentState.Enable(); }