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`
This commit is contained in:
parent
bc9e159b26
commit
201f5b2d0b
@ -50,6 +50,9 @@ impl VolumeLevel {
|
|||||||
pub fn get(&self) -> f32 {
|
pub fn get(&self) -> f32 {
|
||||||
self.0
|
self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Zero (silent) volume level
|
||||||
|
pub const ZERO: Self = VolumeLevel(0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The way Bevy manages the sound playback.
|
/// The way Bevy manages the sound playback.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user