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)
|
.insert_non_send_resource(session_create_info)
|
||||||
.configure_sets(OxrLast, OxrHandleEvents);
|
.configure_sets(OxrLast, OxrHandleEvents);
|
||||||
|
|
||||||
// app.world
|
app.world
|
||||||
// .resource_mut::<MainScheduleOrder>()
|
.resource_mut::<MainScheduleOrder>()
|
||||||
// .insert_after(Last, OxrLast);
|
.insert_after(Last, OxrLast);
|
||||||
|
|
||||||
app.world
|
app.world
|
||||||
.spawn((TransformBundle::default(), OxrTrackingRoot));
|
.spawn((TransformBundle::default(), OxrTrackingRoot));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
use bevy::{
|
use bevy::{
|
||||||
app::SubApp,
|
app::{MainScheduleOrder, SubApp},
|
||||||
ecs::{query::QuerySingleError, schedule::MainThreadExecutor},
|
ecs::{query::QuerySingleError, schedule::MainThreadExecutor},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
render::{
|
render::{
|
||||||
@@ -33,6 +33,16 @@ impl Plugin for OxrRenderPlugin {
|
|||||||
if app.is_plugin_added::<PipelinedRenderingPlugin>() {
|
if app.is_plugin_added::<PipelinedRenderingPlugin>() {
|
||||||
app.init_resource::<Pipelined>();
|
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) {
|
if let Some(sub_app) = app.remove_sub_app(RenderExtractApp) {
|
||||||
app.insert_sub_app(RenderExtractApp, SubApp::new(sub_app.app, update_rendering));
|
app.insert_sub_app(RenderExtractApp, SubApp::new(sub_app.app, update_rendering));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user