Esempio n. 1
0
        //加载声音设置
        private bool OnVoiceSettingsUpdated(string evtName, params object[] param)
        {
            float volBackground = GameSettings.GetFloat("voice.background", 100);
            float volMain       = GameSettings.GetFloat("voice.main", 100);
            float volUI         = GameSettings.GetFloat("voice.ui", 100);

            GameUIAudioMixer.SetFloat("UIMasterVolume", volUI <= 1 ? -60 : (20.0f * Mathf.Log10(volUI / 100.0f)));
            GameMainAudioMixer.SetFloat("MasterVolume", volMain <= 1 ? -60 : (20.0f * Mathf.Log10(volMain / 100.0f)));
            GameMainAudioMixer.SetFloat("BackgroundVolume", volBackground <= 1 ? -60 : (20.0f * Mathf.Log10(volBackground / 100.0f)));

            return(true);
        }