Add feature to enable debug collider viz.
This commit is contained in:
parent
181110c309
commit
281d8b8050
2 changed files with 11 additions and 0 deletions
|
@ -10,6 +10,8 @@ noise = { git = "https://github.com/Razaekel/noise-rs" }
|
|||
hexasphere = "7"
|
||||
wgpu = "0.12"
|
||||
|
||||
[features]
|
||||
debug_render = []
|
||||
|
||||
[dependencies.bevy]
|
||||
version = "0.6"
|
||||
|
|
|
@ -123,6 +123,7 @@ fn setup_bike_collider(bike: Entity, xform: &Transform, commands: &mut Commands)
|
|||
|
||||
pub struct CyberCollidersPlugin;
|
||||
impl Plugin for CyberCollidersPlugin {
|
||||
#[cfg(feature = "debug_render")]
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_plugin(RapierRenderPlugin)
|
||||
.add_startup_system_to_stage(
|
||||
|
@ -130,4 +131,12 @@ impl Plugin for CyberCollidersPlugin {
|
|||
setup_colliders.label("colliders"),
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "debug_render"))]
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_startup_system_to_stage(
|
||||
StartupStage::PostStartup,
|
||||
setup_colliders.label("colliders"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue