public virtual void changeState(NPCState newState, float newDuration) { if (currState != null) { currState.Exit(); } currState = newState; currState.Enter(this, newDuration); }
public virtual void changeState(NPCState newState) { if (currState != null) { currState.Exit(); } currState = newState; currState.Enter(this); }
protected void ChangeState(NPCState to) { // print("【State Changed】 to " + to); if (currentState != null) { currentState.Exit(this); } currentState = to; currentState.Enter(this); }
public void ChangeState(NPCState newState) { currentState.Exit(this); currentState = newState; currentState.Enter(this); }
public virtual void changeState(NPCState newState, NPCState prevState) { // no need to exit previous state(will be returning later, anyways) currState = newState; currState.Enter(this, prevState); }