Fix menu music

This commit is contained in:
2025-07-12 13:54:35 -07:00
parent ccc51bf99a
commit fa4ba4e0e7
3 changed files with 14 additions and 6 deletions

View File

@@ -2388,7 +2388,6 @@ RectTransform:
- {fileID: 673338278}
- {fileID: 989689724}
- {fileID: 603486473}
- {fileID: 2001843693}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
@@ -4603,11 +4602,11 @@ Transform:
m_GameObject: {fileID: 2001843690}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -640, y: -360.04208, z: 0}
m_LocalScale: {x: 1.3459517, y: 1.3459517, z: 1.3459517}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1263503583}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2038556859
GameObject:
@@ -4752,5 +4751,6 @@ SceneRoots:
- {fileID: 101625093}
- {fileID: 1608799622}
- {fileID: 583716567}
- {fileID: 2001843693}
- {fileID: 1263503583}
- {fileID: 1513462405}

View File

@@ -12,7 +12,6 @@ public class MenuMusic : MonoBehaviour
Instance = this;
DontDestroyOnLoad(gameObject);
SceneManager.sceneLoaded += OnSceneLoaded;
GetComponent<AudioSource>().volume = BazookaManager.Instance.GetSettingMusicVolume();
}
else
{
@@ -20,6 +19,11 @@ public class MenuMusic : MonoBehaviour
}
}
void Start()
{
GetComponent<AudioSource>().volume = BazookaManager.Instance.GetSettingMusicVolume();
}
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (scene.name == "GamePlayer")

View File

@@ -43,7 +43,11 @@ public class SettingsMenu : MonoBehaviour
QualitySettings.vSyncCount = value ? 1 : -1;
});
setting4toggle.onValueChanged.AddListener(value => BazookaManager.Instance.SetSettingHideSocials(value));
musicSlider.onValueChanged.AddListener(value => BazookaManager.Instance.SetSettingMusicVolume(value));
musicSlider.onValueChanged.AddListener(value =>
{
BazookaManager.Instance.SetSettingMusicVolume(value);
MenuMusic.Instance.GetComponent<AudioSource>().volume = value;
});
sfxSlider.onValueChanged.AddListener(value => BazookaManager.Instance.SetSettingSFXVolume(value));
}
}