removed uneeded changes
This commit is contained in:
@@ -84,7 +84,6 @@ fn bind_actions(instance: Res<OxrInstance>, mut actions: EventReader<OxrSuggestA
|
|||||||
),
|
),
|
||||||
openxr::sys::Result::ERROR_PATH_INVALID => error!("Invalid Path Suggested!"),
|
openxr::sys::Result::ERROR_PATH_INVALID => error!("Invalid Path Suggested!"),
|
||||||
openxr::sys::Result::ERROR_PATH_UNSUPPORTED => error!("Suggested Path Unsupported!"),
|
openxr::sys::Result::ERROR_PATH_UNSUPPORTED => error!("Suggested Path Unsupported!"),
|
||||||
openxr::sys::Result::SUCCESS => info!("Suggested binding success"),
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
use crate::resources::OxrSession;
|
use crate::resources::OxrSession;
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
use bevy_xr::session::status_changed_to;
|
use bevy_xr::session::status_changed_to;
|
||||||
use openxr::ActionSet;
|
|
||||||
|
|
||||||
impl Plugin for OxrActionAttachingPlugin {
|
impl Plugin for OxrActionAttachingPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
@@ -10,15 +9,10 @@ impl Plugin for OxrActionAttachingPlugin {
|
|||||||
PostUpdate,
|
PostUpdate,
|
||||||
attach_sets.run_if(status_changed_to(bevy_xr::session::XrStatus::Ready)),
|
attach_sets.run_if(status_changed_to(bevy_xr::session::XrStatus::Ready)),
|
||||||
);
|
);
|
||||||
app.init_resource::<AttachedActionSets>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attach_sets(
|
fn attach_sets(session: Res<OxrSession>, mut events: EventReader<OxrAttachActionSet>) {
|
||||||
session: Res<OxrSession>,
|
|
||||||
mut events: EventReader<OxrAttachActionSet>,
|
|
||||||
mut attached: ResMut<AttachedActionSets>,
|
|
||||||
) {
|
|
||||||
let sets = events.read().map(|v| &v.0).collect::<Vec<_>>();
|
let sets = events.read().map(|v| &v.0).collect::<Vec<_>>();
|
||||||
if sets.is_empty() {
|
if sets.is_empty() {
|
||||||
return;
|
return;
|
||||||
@@ -27,10 +21,6 @@ fn attach_sets(
|
|||||||
match session.attach_action_sets(&sets) {
|
match session.attach_action_sets(&sets) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
info!("attached sessions!");
|
info!("attached sessions!");
|
||||||
for &set in sets.iter() {
|
|
||||||
let clone = set.clone();
|
|
||||||
attached.sets.push(clone);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Err(openxr::sys::Result::ERROR_ACTIONSETS_ALREADY_ATTACHED) => {
|
Err(openxr::sys::Result::ERROR_ACTIONSETS_ALREADY_ATTACHED) => {
|
||||||
error!("Action Sets Already attached!");
|
error!("Action Sets Already attached!");
|
||||||
@@ -50,8 +40,3 @@ fn attach_sets(
|
|||||||
pub struct OxrAttachActionSet(pub openxr::ActionSet);
|
pub struct OxrAttachActionSet(pub openxr::ActionSet);
|
||||||
|
|
||||||
pub struct OxrActionAttachingPlugin;
|
pub struct OxrActionAttachingPlugin;
|
||||||
|
|
||||||
#[derive(Resource, Default)]
|
|
||||||
pub struct AttachedActionSets {
|
|
||||||
pub sets: Vec<ActionSet>,
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user