diff --git a/Assets/Scripts/Helper/MasterVolume.cs b/Assets/Scripts/Helper/MasterVolume.cs index cfcc61c..7950c3f 100644 --- a/Assets/Scripts/Helper/MasterVolume.cs +++ b/Assets/Scripts/Helper/MasterVolume.cs @@ -72,11 +72,14 @@ public static class MasterVolume Debug.LogWarning($"[MasterVolume] Exposed parameter '{ExposedParam}' not found on the AudioMixer."); } - // Push the saved level before any scene audio starts. SetFloat overrides the exposed parameter - // permanently (until ClearFloat), so the start snapshot's authored value is superseded. + // Push the saved level at startup. SetFloat before the first frame is discarded when the mixer + // activates its start snapshot (known Unity behavior: exposed params set in Awake/BeforeSceneLoad + // get reset), so apply immediately for best effort and again one frame later to make it stick. [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] - private static void ApplyOnStartup() + private static async void ApplyOnStartup() { Apply(Volume); + await Awaitable.NextFrameAsync(); + Apply(Volume); } }