public virtual void Start() { state = startState; state.OnEnter(transform); // Characters should set up stats here }
/// <summary> /// Set this character's state /// </summary> /// <param name="newState"></param> public virtual void SetState(I_ActorState newState) { SwitchState(newState); }
/// <summary> /// Switch to a new state /// </summary> /// <param name="newState"></param> protected virtual void SwitchState(I_ActorState newState) { state.OnExit(transform); state = newState; state.OnEnter(transform); }