Пример #1
0
 // Sonify Key
 public void SonifyKey()
 {
     // If chair is behind the subject, say "turn around"
     AimingError = Vector3.Angle(TargetPosition - Camera.main.transform.position, Camera.main.transform.forward);
     if (Math.Abs(AimingError) > BackThreshold)
     {
         TurnAroundSource.Play();
         AimingError = 0f;
     }
     else
     {
         KeySource.pitch = Math.Max(1.5f - 0.5f * (float)Math.Log10(TargetDistance + 1f), 0.5f);
         KeySource.Play();
     }
 }
Пример #2
0
 // Sonify Chair
 public void SonifyChair()
 {
     // If chair is behind the subject, say "turn around"
     CalculateError();
     if (Math.Abs(AimingError) > BackThreshold)
     {
         TurnAroundSource.Play();
         AimingError = 0f;
     }
     else
     {
         ChairSource.pitch = Math.Max(1.5f - 0.5f * (float)Math.Log10(TargetDistance + 1f), 0.5f);
         ChairSource.Play();
     }
 }