예제 #1
0
    public virtual void Start()
    {
        state = startState;
        state.OnEnter(transform);

        // Characters should set up stats here
    }
예제 #2
0
 /// <summary>
 /// Set this character's state
 /// </summary>
 /// <param name="newState"></param>
 public virtual void SetState(I_ActorState newState)
 {
     SwitchState(newState);
 }
예제 #3
0
 /// <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);
 }