@@ -28,7 +28,7 @@ impl Plugin for OxrActionBindingPlugin {
|
||||
|
||||
// This could for now be handled better with a SystemSet, but in the future we might want to add an
|
||||
// Event to allow requesting binding suggestion for new actions
|
||||
fn run_action_binding_sugestion(world: &mut World) {
|
||||
pub(crate) fn run_action_binding_sugestion(world: &mut World) {
|
||||
world.run_schedule(OxrSendActionBindings);
|
||||
world.run_system_once(bind_actions);
|
||||
}
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
use crate::session::{OxrSession, OxrSessionStatusEvent};
|
||||
use crate::{action_binding::run_action_binding_sugestion, session::{OxrSession, OxrSessionStatusEvent}};
|
||||
use bevy::prelude::*;
|
||||
use bevy_xr::session::status_changed_to;
|
||||
|
||||
impl Plugin for OxrActionAttachingPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_event::<OxrAttachActionSet>();
|
||||
app.add_systems(
|
||||
PostUpdate,
|
||||
attach_sets.run_if(|mut session_status_event: EventReader<OxrSessionStatusEvent>| {
|
||||
session_status_event
|
||||
.read()
|
||||
.any(|s| *s == OxrSessionStatusEvent::Created)
|
||||
}),
|
||||
attach_sets
|
||||
.run_if(
|
||||
|mut session_status_event: EventReader<OxrSessionStatusEvent>| {
|
||||
session_status_event
|
||||
.read()
|
||||
.any(|s| *s == OxrSessionStatusEvent::Created)
|
||||
},
|
||||
)
|
||||
.after(run_action_binding_sugestion),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user