fix status_changed_to, added OxrSuggestActionBindings event to app and fixed scheduling for run_action_binding_sugestion
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -13,10 +13,11 @@ use crate::resources::OxrInstance;
|
||||
impl Plugin for OxrActionBindingPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_schedule(Schedule::new(OxrSendActionBindings));
|
||||
app.add_event::<OxrSuggestActionBinding>();
|
||||
app.add_systems(
|
||||
Update,
|
||||
run_action_binding_sugestion
|
||||
.run_if(run_once().and_then(status_changed_to(XrStatus::Ready))),
|
||||
.run_if(status_changed_to(XrStatus::Ready).and_then(run_once())),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,9 @@ impl Plugin for OxrActionAttachingPlugin {
|
||||
|
||||
fn attach_sets(session: Res<OxrSession>, mut events: EventReader<OxrAttachActionSet>) {
|
||||
let sets = events.read().map(|v| &v.0).collect::<Vec<_>>();
|
||||
info!("attaching {} sessions", sets.len());
|
||||
match session.attach_action_sets(&sets) {
|
||||
Ok(_) => {}
|
||||
Ok(_) => {info!("attached sessions!")}
|
||||
Err(openxr::sys::Result::ERROR_ACTIONSETS_ALREADY_ATTACHED) => {
|
||||
error!("Action Sets Already attached!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user