Ejemplo n.º 1
0
        private float GetVolume(string eventName)
        {
            AudioEventData clipData = GetAudioClipData(eventName);

            float volume = clipData.volume;

            if (clipData.volumeVariance > 0.0f)
            {
                volume = Mathf.Clamp(Random.Range(clipData.volume - clipData.volumeVariance, clipData.volume + clipData.volumeVariance), 0.01f, 1.0f);
            }

            return(volume);
        }
Ejemplo n.º 2
0
        private float GetPitch(string eventName)
        {
            AudioEventData clipData = GetAudioClipData(eventName);

            float pitch = clipData.pitch;

            if (clipData.pitchVariance > 0.0f)
            {
                pitch = Mathf.Clamp(Random.Range(clipData.pitch - clipData.pitchVariance, clipData.pitch + clipData.pitchVariance), 0.01f, 3.0f);
            }

            return(pitch);
        }