Skip to content

Commit b0ff5b7

Browse files
committed
No RenderApp? No problem.
1 parent 7a1cd06 commit b0ff5b7

File tree

1 file changed

+7
-5
lines changed
  • crates/bevy_debug_draw/src

1 file changed

+7
-5
lines changed

crates/bevy_debug_draw/src/lib.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@ impl Plugin for DebugDrawPlugin {
4545

4646
app.init_resource::<DebugDraw>()
4747
.init_resource::<DebugDrawConfig>()
48-
.add_system_to_stage(CoreStage::Last, update)
49-
.sub_app_mut(RenderApp)
50-
.add_system_to_stage(RenderStage::Extract, extract);
48+
.add_system_to_stage(CoreStage::Last, update);
49+
50+
let Ok(render_app) = app.get_sub_app_mut(RenderApp) else { return; };
51+
52+
render_app.add_system_to_stage(RenderStage::Extract, extract);
5153

5254
#[cfg(feature = "bevy_sprite")]
5355
{
5456
use bevy_core_pipeline::core_2d::Transparent2d;
5557
use pipeline_2d::*;
5658

57-
app.sub_app_mut(RenderApp)
59+
render_app
5860
.add_render_command::<Transparent2d, DrawDebugLines>()
5961
.init_resource::<DebugLinePipeline>()
6062
.init_resource::<SpecializedMeshPipelines<DebugLinePipeline>>()
@@ -66,7 +68,7 @@ impl Plugin for DebugDrawPlugin {
6668
use bevy_core_pipeline::core_3d::Opaque3d;
6769
use pipeline_3d::*;
6870

69-
app.sub_app_mut(RenderApp)
71+
render_app
7072
.add_render_command::<Opaque3d, DrawDebugLines>()
7173
.init_resource::<DebugLinePipeline>()
7274
.init_resource::<SpecializedMeshPipelines<DebugLinePipeline>>()

0 commit comments

Comments
 (0)