示例#1
0
 void _SetVolume(string key, float value)
 {
     if (AudioSettings.ContainsTypeKey(key))
     {
         audioMixer.SetFloat(key, value);
     }
 }
示例#2
0
 void _LoadAudioSettings(AudioSettings audio)
 {
     foreach (string k in audio.Keys)
     {
         if (AudioSettings.ContainsTypeKey(k))
         {
             float v;
             if (audio.TryGetValue(k, out v))
             {
                 _SetVolume(k, v);
             }
             else
             {
                 Debug.LogError($"An error occurred while parsing '{k}' key of audio settings");
             }
         }
     }
     Debug.Log("");
 }