Skip to content

Commit

Permalink
update XrSetup Scheduling to allow other plugins to run before in Sta…
Browse files Browse the repository at this point in the history
…rtup
  • Loading branch information
Schmarni-Dev committed Dec 11, 2023
1 parent b59e5be commit ae8c5ef
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions src/xr_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ use bevy::{
prelude::*,
render::{
extract_resource::{ExtractResource, ExtractResourcePlugin},
renderer::{
self, RenderAdapter, RenderAdapterInfo, RenderDevice, RenderInstance, RenderQueue,
},
renderer::{self, RenderAdapter, RenderAdapterInfo, RenderDevice, RenderQueue},
settings::WgpuSettings,
},
window::{PrimaryWindow, RawHandleWrapper},
window::RawHandleWrapper,
};
use wgpu::Instance;

use crate::{
graphics,
input::XrInput,
resources::{
XrEnvironmentBlendMode, XrFormat, XrFrameState, XrFrameWaiter, XrInstance, XrResolution,
Expand Down Expand Up @@ -107,9 +104,7 @@ impl Plugin for RenderRestartPlugin {
.insert_resource(ForceMain)
.add_event::<XrEnableRequest>()
.add_event::<XrEnableStatus>()
.add_systems(PreStartup, xr_presetup.run_if(xr_only()))
.add_systems(Startup, xr_setup.run_if(xr_only()))
.add_systems(PostStartup, xr_postsetup.run_if(xr_only()))
.add_systems(PostStartup, setup_xr.run_if(xr_only()))
.add_systems(
PostUpdate,
update_xr_stuff.run_if(on_event::<XrEnableRequest>()),
Expand Down Expand Up @@ -154,17 +149,6 @@ fn add_schedules(app: &mut App) {
}
}

fn xr_presetup(world: &mut World) {
world.run_schedule(XrPreSetup);
}
fn xr_setup(world: &mut World) {
world.run_schedule(XrSetup);
}
fn xr_postsetup(world: &mut World) {
world.run_schedule(XrPrePostSetup);
world.run_schedule(XrPostSetup);
}

fn setup_xr(world: &mut World) {
world.run_schedule(XrPreSetup);
world.run_schedule(XrSetup);
Expand Down

0 comments on commit ae8c5ef

Please sign in to comment.