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:
Johan Klokkhammer Helsing 2023-11-17 16:15:56 +01:00 committed by GitHub
parent bc9e159b26
commit 201f5b2d0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.