mirror of
https://github.com/lightsoutgames/bevy_openal.git
synced 2024-11-12 21:05:56 +00:00
Partial fix for pausing/resuming sources.
This commit is contained in:
parent
ba375532b6
commit
e9f7f2b9ff
|
@ -236,7 +236,12 @@ fn source_update(
|
|||
}
|
||||
}
|
||||
SoundState::Playing => {
|
||||
if sound.source.is_none() {
|
||||
if let Some(source) = sound.source.as_mut() {
|
||||
let source_state = source.state();
|
||||
if source_state == SourceState::Paused {
|
||||
source.play();
|
||||
}
|
||||
} else {
|
||||
let mut source = context.new_static_source().unwrap();
|
||||
if let Some(buffer) = buffers.0.get(&sound.buffer.id) {
|
||||
source.set_buffer(buffer.clone()).unwrap();
|
||||
|
|
Loading…
Reference in New Issue
Block a user