예제 #1
0
 public void ChangeState(AI_State nextState)
 {
     currentState.EndStateForBrain(this);
     previousState = currentState;
     currentState  = nextState;
     currentState.InitializeStateForBrain(this);
 }
예제 #2
0
 private void Awake()
 {
     currentState    = initialState;
     navMeshAgent    = this.transform.GetComponent <NavMeshAgent>();
     brain_animator  = this.transform.GetComponent <Animator>();
     brain_rigidbody = this.transform.GetComponent <Rigidbody>();
     if (currentState != null)
     {
         currentState.InitializeStateForBrain(this);
     }
 }