feat: impl proper entity handles

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-10-28 23:02:24 +01:00
parent ec468b6752
commit 65c426f981
6 changed files with 59 additions and 38 deletions

View File

@@ -73,10 +73,11 @@ fn update_sound_event(
},
))
.id();
sound.spatial.set_entity(entity);
sound.entity.set(entity.into()).unwrap();
let entity = EntityHandle::new(entity);
sound.spatial.set_entity(entity.clone());
sound.entity.set(entity).unwrap();
}
if let Some(sink) = sound.entity.get().and_then(|e| sinks.get(e.0).ok()) {
if let Some(sink) = sound.entity.get().and_then(|e| sinks.get(e.get()).ok()) {
if sound.play.lock().take().is_some() {
sink.play();
}