Ejemplo n.º 1
0
    private void TransitionToStateGoToSound(DetectedSound detectedSound, float newSoundPriority)
    {
        lastDetectedSound  = detectedSound;
        timeSinceLastSound = 0;

        currentState = newSoundPriority > sprintThreshold ? MonsterState.SprintToSound : MonsterState.GoToSound;
        monsterStateGoToSound.EnterState(lastDetectedSound, currentState);
    }
Ejemplo n.º 2
0
 // Just always hear the sound if we get sent this
 public void DetectDistractionSound(DetectedSound detectedSound)
 {
     if (monsterStateGoToSound != null)
     {
         float newSoundPriority = detectedSound.GetPriority(transform.position);
         TransitionToStateGoToSound(detectedSound, newSoundPriority);
     }
 }
Ejemplo n.º 3
0
 // When a sound make a noise, it calls this to alert the monster to it
 public void DetectSound(DetectedSound detectedSound)
 {
     if (monsterStateGoToSound != null)
     {
         // Sound priority must be above threshold
         float newSoundPriority = detectedSound.GetPriority(transform.position);
         if (newSoundPriority > hearSoundThreshold)
         {
             TransitionToStateGoToSound(detectedSound, newSoundPriority);
         }
     }
 }
Ejemplo n.º 4
0
 private void ExitStateInvestigatePoint()
 {
     lastDetectedSound = null;
     currentState      = MonsterState.Wander;
     monsterStateWander.EnterState();
 }