add compatibility for both pipelined and unpipelined
This commit is contained in:
@@ -150,9 +150,9 @@ impl Plugin for OxrInitPlugin {
|
||||
.insert_non_send_resource(session_create_info)
|
||||
.configure_sets(OxrLast, OxrHandleEvents);
|
||||
|
||||
// app.world
|
||||
// .resource_mut::<MainScheduleOrder>()
|
||||
// .insert_after(Last, OxrLast);
|
||||
app.world
|
||||
.resource_mut::<MainScheduleOrder>()
|
||||
.insert_after(Last, OxrLast);
|
||||
|
||||
app.world
|
||||
.spawn((TransformBundle::default(), OxrTrackingRoot));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use bevy::{
|
||||
app::SubApp,
|
||||
app::{MainScheduleOrder, SubApp},
|
||||
ecs::{query::QuerySingleError, schedule::MainThreadExecutor},
|
||||
prelude::*,
|
||||
render::{
|
||||
@@ -33,6 +33,16 @@ impl Plugin for OxrRenderPlugin {
|
||||
if app.is_plugin_added::<PipelinedRenderingPlugin>() {
|
||||
app.init_resource::<Pipelined>();
|
||||
|
||||
let mut schedule_order = app.world.resource_mut::<MainScheduleOrder>();
|
||||
|
||||
if let Some(pos) = schedule_order
|
||||
.labels
|
||||
.iter()
|
||||
.position(|label| (**label).eq(&OxrLast))
|
||||
{
|
||||
schedule_order.labels.remove(pos);
|
||||
}
|
||||
|
||||
if let Some(sub_app) = app.remove_sub_app(RenderExtractApp) {
|
||||
app.insert_sub_app(RenderExtractApp, SubApp::new(sub_app.app, update_rendering));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user