Merge branch 'add-gamewin-audio-events' of https://github.com/Tryibion/FlaxEngine into Tryibion-add-gamewin-audio-events
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user