change scheduling

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2024-05-19 04:48:49 +02:00
parent 72f2e7174e
commit fb9ec378c8
12 changed files with 292 additions and 127 deletions

View File

@@ -1,4 +1,4 @@
use crate::resources::OxrSession;
use crate::session::{OxrSession, OxrSessionStatusEvent};
use bevy::prelude::*;
use bevy_xr::session::status_changed_to;
@@ -7,7 +7,11 @@ impl Plugin for OxrActionAttachingPlugin {
app.add_event::<OxrAttachActionSet>();
app.add_systems(
PostUpdate,
attach_sets.run_if(status_changed_to(bevy_xr::session::XrStatus::Ready)),
attach_sets.run_if(|mut session_status_event: EventReader<OxrSessionStatusEvent>| {
session_status_event
.read()
.any(|s| *s == OxrSessionStatusEvent::Created)
}),
);
}
}