private void Awake() { states = new Dictionary <BearState, BearStateBase> (); states.Add(BearState.Patrol, new PatrolState(this)); states.Add(BearState.Alert, new AlertState(this)); states.Add(BearState.Chase, new ChaseState(this)); states.Add(BearState.Attack, new AttackState(this)); currentState = states [BearState.Patrol]; }
public void MakeTransition(BearState state) { Debug.Log(state); currentState = states[state]; currentState.StartState(); }