fix crash when running without an openxr runtime
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
use std::{mem, ptr};
|
use std::{mem, ptr};
|
||||||
|
|
||||||
use bevy::prelude::*;
|
use bevy::prelude::*;
|
||||||
|
use bevy_xr::session::session_available;
|
||||||
use openxr::sys;
|
use openxr::sys;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@@ -15,7 +16,7 @@ impl Plugin for OxrOverlayPlugin {
|
|||||||
fn build(&self, app: &mut bevy::prelude::App) {
|
fn build(&self, app: &mut bevy::prelude::App) {
|
||||||
app.add_event::<OxrOverlaySessionEvent>();
|
app.add_event::<OxrOverlaySessionEvent>();
|
||||||
app.init_resource::<OxrOverlaySettings>();
|
app.init_resource::<OxrOverlaySettings>();
|
||||||
app.add_systems(First, add_overlay_info_to_chain);
|
app.add_systems(First, add_overlay_info_to_chain.run_if(session_available));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user