update XrSetup Scheduling to allow other plugins to run before in Startup
This commit is contained in:
@@ -8,17 +8,14 @@ use bevy::{
|
|||||||
prelude::*,
|
prelude::*,
|
||||||
render::{
|
render::{
|
||||||
extract_resource::{ExtractResource, ExtractResourcePlugin},
|
extract_resource::{ExtractResource, ExtractResourcePlugin},
|
||||||
renderer::{
|
renderer::{self, RenderAdapter, RenderAdapterInfo, RenderDevice, RenderQueue},
|
||||||
self, RenderAdapter, RenderAdapterInfo, RenderDevice, RenderInstance, RenderQueue,
|
|
||||||
},
|
|
||||||
settings::WgpuSettings,
|
settings::WgpuSettings,
|
||||||
},
|
},
|
||||||
window::{PrimaryWindow, RawHandleWrapper},
|
window::RawHandleWrapper,
|
||||||
};
|
};
|
||||||
use wgpu::Instance;
|
use wgpu::Instance;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
graphics,
|
|
||||||
input::XrInput,
|
input::XrInput,
|
||||||
resources::{
|
resources::{
|
||||||
XrEnvironmentBlendMode, XrFormat, XrFrameState, XrFrameWaiter, XrInstance, XrResolution,
|
XrEnvironmentBlendMode, XrFormat, XrFrameState, XrFrameWaiter, XrInstance, XrResolution,
|
||||||
@@ -107,9 +104,7 @@ impl Plugin for RenderRestartPlugin {
|
|||||||
.insert_resource(ForceMain)
|
.insert_resource(ForceMain)
|
||||||
.add_event::<XrEnableRequest>()
|
.add_event::<XrEnableRequest>()
|
||||||
.add_event::<XrEnableStatus>()
|
.add_event::<XrEnableStatus>()
|
||||||
.add_systems(PreStartup, xr_presetup.run_if(xr_only()))
|
.add_systems(PostStartup, setup_xr.run_if(xr_only()))
|
||||||
.add_systems(Startup, xr_setup.run_if(xr_only()))
|
|
||||||
.add_systems(PostStartup, xr_postsetup.run_if(xr_only()))
|
|
||||||
.add_systems(
|
.add_systems(
|
||||||
PostUpdate,
|
PostUpdate,
|
||||||
update_xr_stuff.run_if(on_event::<XrEnableRequest>()),
|
update_xr_stuff.run_if(on_event::<XrEnableRequest>()),
|
||||||
@@ -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) {
|
fn setup_xr(world: &mut World) {
|
||||||
world.run_schedule(XrPreSetup);
|
world.run_schedule(XrPreSetup);
|
||||||
world.run_schedule(XrSetup);
|
world.run_schedule(XrSetup);
|
||||||
|
|||||||
Reference in New Issue
Block a user