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