Menu music listens to volume slider now
This commit is contained in:
@@ -12,6 +12,7 @@ public class MenuMusic : MonoBehaviour
|
|||||||
Instance = this;
|
Instance = this;
|
||||||
DontDestroyOnLoad(gameObject);
|
DontDestroyOnLoad(gameObject);
|
||||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||||
|
GetComponent<AudioSource>().volume = PlayerPrefs.GetFloat("musicVolume", 1f);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public class SettingsMenu : MonoBehaviour
|
|||||||
{
|
{
|
||||||
PlayerPrefs.SetFloat("musicVolume", value);
|
PlayerPrefs.SetFloat("musicVolume", value);
|
||||||
PlayerPrefs.Save();
|
PlayerPrefs.Save();
|
||||||
|
MenuMusic.Instance.GetComponent<AudioSource>().volume = value;
|
||||||
});
|
});
|
||||||
sfxSlider.onValueChanged.AddListener(value =>
|
sfxSlider.onValueChanged.AddListener(value =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user