示例#1
0
    public static float Get(AudioMixer mixer, MixerVolume.Names name)
    {
        float num = 0.0f;

        return(!mixer.GetFloat(name.ToString(), ref num) ? 0.0f : Mathf.InverseLerp(-80f, 0.0f, num));
    }
示例#2
0
    public static void Set(AudioMixer mixer, MixerVolume.Names name, float volume)
    {
        float num = 20f * Mathf.Log10(Mathf.Clamp(volume, 0.0001f, 1f));

        mixer.SetFloat(name.ToString(), Mathf.Clamp(num, -80f, 0.0f));
    }