9 using System.Collections;
11 namespace Valve.VR.InteractionSystem
17 public AnimationCurve pitchCurve;
18 public float minPitch;
19 public float maxPitch;
20 public bool applyContinuously =
true;
22 private AudioSource audioSource;
28 if ( audioSource == null )
30 audioSource = GetComponent<AudioSource>();
33 if ( linearMapping == null )
35 linearMapping = GetComponent<LinearMapping>();
43 if ( applyContinuously )
53 float y = pitchCurve.Evaluate( linearMapping.value );
55 audioSource.pitch = Mathf.Lerp( minPitch, maxPitch, y );