Exemplo n.º 1
0
 public override void Process()
 {
     base.Process();
     if (sound != null)
     {
         if (affectVolume)
         {
             float volume = Mathf.Lerp(volumeMin, volumeMax, input.value);
             sound.SetVolume(volume);
         }
         if (affectLowPassFilter)
         {
             float lowPass = Mathf.Lerp(lowPassMin, lowPassMax, input.value);
             sound.SetLowPass(lowPass);
         }
         if (affectPitch)
         {
             float pitch = Mathf.Lerp(pitchMin, pitchMax, input.value);
             sound.SetPitch(pitch);
         }
     }
     else if (unitySound != null)
     {
         if (affectVolume)
         {
             float volume2 = Mathf.Lerp(volumeMin, volumeMax, input.value);
             unitySound.volume = volume2;
         }
         if (affectLowPassFilter)
         {
             float cutoffFrequency        = Mathf.Lerp(lowPassMin, lowPassMax, input.value);
             AudioLowPassFilter component = unitySound.GetComponent <AudioLowPassFilter>();
             component.cutoffFrequency = cutoffFrequency;
         }
         if (affectPitch)
         {
             float pitch2 = Mathf.Lerp(pitchMin, pitchMax, input.value);
             unitySound.pitch = pitch2;
         }
     }
 }