コード例 #1
0
 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];
 }
コード例 #2
0
 public void MakeTransition(BearState state)
 {
     Debug.Log(state);
     currentState = states[state];
     currentState.StartState();
 }