private void OnCollisionEnter(Collision collision) { var hitVelocity = collision.relativeVelocity.magnitude; if (hitVelocity >= HitVelocityThreshold) { var volume = CoolMath.SmoothStep(0.7f * HitVelocityThreshold, 2 * HitVelocityThreshold, hitVelocity); MirroredAudioSource.PlayClipAtPoint(CollisionSound, transform.position, volume); } }
private void OnRoar() { MirroredAudioSource.PlayClipAtPoint(RoarSound, transform.position); }
private void OnStep() { MirroredAudioSource.PlayClipAtPoint(stepSwitch ? StepSound1 : StepSound2, transform.position, StepVolume); stepSwitch = !stepSwitch; }