mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
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
1 changed files with 3 additions and 0 deletions
|
@ -50,6 +50,9 @@ impl VolumeLevel {
|
|||
pub fn get(&self) -> f32 {
|
||||
self.0
|
||||
}
|
||||
|
||||
/// Zero (silent) volume level
|
||||
pub const ZERO: Self = VolumeLevel(0.0);
|
||||
}
|
||||
|
||||
/// The way Bevy manages the sound playback.
|
||||
|
|
Loading…
Reference in a new issue