mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-11-24 18:25:57 +00:00
Add support for changing source pitch.
This commit is contained in:
parent
2c75e46f1b
commit
ab0e8e60c8
|
@ -121,6 +121,7 @@ pub struct Sound {
|
||||||
pub autoplay: bool,
|
pub autoplay: bool,
|
||||||
pub gain: f32,
|
pub gain: f32,
|
||||||
pub looping: bool,
|
pub looping: bool,
|
||||||
|
pub pitch: f32,
|
||||||
#[reflect(ignore)]
|
#[reflect(ignore)]
|
||||||
pub source: Option<StaticSource>,
|
pub source: Option<StaticSource>,
|
||||||
}
|
}
|
||||||
|
@ -132,6 +133,7 @@ impl Default for Sound {
|
||||||
autoplay: false,
|
autoplay: false,
|
||||||
gain: 1.,
|
gain: 1.,
|
||||||
looping: false,
|
looping: false,
|
||||||
|
pitch: 1.,
|
||||||
source: None,
|
source: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,6 +161,7 @@ fn source_system(
|
||||||
if let Some(source) = sound.source.as_mut() {
|
if let Some(source) = sound.source.as_mut() {
|
||||||
source.set_gain(sound.gain).unwrap();
|
source.set_gain(sound.gain).unwrap();
|
||||||
source.set_looping(sound.looping);
|
source.set_looping(sound.looping);
|
||||||
|
source.set_pitch(sound.pitch).unwrap();
|
||||||
if let Some(transform) = transform {
|
if let Some(transform) = transform {
|
||||||
source.set_relative(false);
|
source.set_relative(false);
|
||||||
source
|
source
|
||||||
|
|
Loading…
Reference in New Issue
Block a user