// 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); } }
// 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); } } }