void EnforceVolumePref(SoundVolume soundVolume) { string audioMixerParameter = Options.AudioMixerParameterBySoundVolume[soundVolume]; AudioMixer.GetFloat(audioMixerParameter, out float currentVolume); float x = PlayerPrefs.GetFloat(audioMixerParameter, 7f); AudioMixer.SetFloat(audioMixerParameter, Mathf.Log10(MyMethods.ConvertValueFromOldScaleToNewScale(x, 0, 15, 0.0001f, 1f)) * 20); }
public void VolumeChange(SoundVolume volumeToChange, float newValue) { PlayerPrefs.SetFloat(AudioMixerParameterBySoundVolume[volumeToChange], newValue); AudioMixer.SetFloat(AudioMixerParameterBySoundVolume[volumeToChange], Mathf.Log10(MyMethods.ConvertValueFromOldScaleToNewScale(newValue, 0, 15, 0.0001f, 1f)) * 20); }