Skip to content

Commit 201f5b2

Browse files
authored
Add VolumeLevel::ZERO (#10608)
# Objective - Handy to have a constant instead of `VolumeLevel::new(0.0)` - `VolumeLevel::new` is not `const` ## Solution - Adds a `VolumeLevel::ZERO` constant, which we have for most of our other types where it makes sense. --- ## Changelog - Add `VolumeLevel::ZERO`
1 parent bc9e159 commit 201f5b2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/bevy_audio/src/audio.rs

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ impl VolumeLevel {
5050
pub fn get(&self) -> f32 {
5151
self.0
5252
}
53+
54+
/// Zero (silent) volume level
55+
pub const ZERO: Self = VolumeLevel(0.0);
5356
}
5457

5558
/// The way Bevy manages the sound playback.

0 commit comments

Comments
 (0)