Add events for when audio settings are changed for the game window.

This commit is contained in:
Chandler Cox
2025-08-17 11:58:42 -05:00
parent 606dfa4e2e
commit a02b7d4a1a

View File

@@ -63,6 +63,16 @@ namespace FlaxEditor.Windows
},
};
/// <summary>
/// Fired when the game window audio is muted.
/// </summary>
public event Action MuteAudio;
/// <summary>
/// Fired when the game window master audio volume is changed.
/// </summary>
public event Action<float> MasterVolumeChanged;
/// <summary>
/// Gets the viewport.
/// </summary>
@@ -120,6 +130,7 @@ namespace FlaxEditor.Windows
{
Audio.MasterVolume = value ? 0 : AudioVolume;
_audioMuted = value;
MuteAudio?.Invoke();
}
}
@@ -134,6 +145,7 @@ namespace FlaxEditor.Windows
if (!AudioMuted)
Audio.MasterVolume = value;
_audioVolume = value;
MasterVolumeChanged?.Invoke(value);
}
}