Merge branch 'main' into synthizer

This commit is contained in:
Nolan Darilek 2022-05-31 10:38:05 -05:00
commit b2e4f9b729

View File

@ -121,13 +121,15 @@ fn update<S>(
) in icons.iter_mut()
{
let entity = if visibility.is_some() {
icon_entity
Some(icon_entity)
} else if parent.is_some() {
Some(**parent.unwrap())
} else {
**parent.unwrap()
None
};
if let Some(entity) = entity {
if visible.contains(&entity) {
let looping = sound.looping;
if looping {
if sound.looping {
sound.paused = false;
} else if let Some(interval) = icon.interval.as_mut() {
interval.tick(time.delta());
@ -138,12 +140,12 @@ fn update<S>(
}
}
let buffer = asset_server.get_handle(icon.sound);
sound.looping = icon.interval.is_none();
if sound.buffer != buffer {
sound.buffer = buffer;
}
sound.gain = icon.gain;
sound.pitch = icon.pitch;
sound.looping = icon.interval.is_none();
if let Some(v) = icon.reference_distance {
let insert = if let Some(v2) = distance_ref {
v != **v2
@ -192,6 +194,7 @@ fn update<S>(
entity.remove::<Rolloff>();
});
}
}
} else {
sound.paused = true;
}