HeavenStudioPlus/Assets/Scripts/Settings.cs

32 lines
1 KiB
C#
Raw Normal View History

2022-02-05 04:40:33 +00:00
using UnityEngine;
using UnityEngine.Audio;
2022-03-14 14:21:05 +00:00
namespace HeavenStudio
2022-02-05 04:40:33 +00:00
{
public class Settings : MonoBehaviour
{
public static AudioMixerGroup GetMusicMixer()
{
AudioMixerGroup audioMixerGroup = Resources.Load<AudioMixer>("MainMixer").FindMatchingGroups("Music")[0];
AudioMixer audioMixer = GetMainMixer();
// float vol = Mathf.Log10(GetMusicVolume()) * 20;
// audioMixer.SetFloat("MusicVolume", vol);
return audioMixerGroup;
}
public static AudioMixerGroup GetSFXMixer()
{
AudioMixerGroup audioMixerGroup = Resources.Load<AudioMixer>("MainMixer").FindMatchingGroups("SFX")[0];
AudioMixer audioMixer = GetMainMixer();
// float vol = Mathf.Log10(GetSFXVolume()) * 20;
// audioMixer.SetFloat("SFXVolume", vol);
return audioMixerGroup;
}
public static AudioMixer GetMainMixer()
{
return Resources.Load<AudioMixer>("MainMixer");
}
}
}