Ejemplo n.º 1
0
 // This is the idle state, it stands still and waits for something to tell it to swap to a different state.
 public virtual void stateIdle()
 {
     if (transform.position != spawnPosition)
     {
         controller.currentState = Controller.AIStates.reset;
     }
     if (sight.inLineOfSight())
     {
         targetPosition          = sight.target.transform.position;
         controller.currentState = Controller.AIStates.pursue;
     }
     if (hearing.listenForNoise())
     {
         targetPosition          = hearing.targetNoiseMaker.gameObject.transform.position;
         controller.currentState = Controller.AIStates.pursue;
     }
 }