Skip to content

Commit 22a8e98

Browse files
committed
simpler serialization example
1 parent 5563ba9 commit 22a8e98

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bevy_rapier2d/examples/serialization2.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Example for RapierContext serialization, run with `--features serde-serialize`.
22
33
use bevy::prelude::*;
4+
use bevy::MinimalPlugins;
45
use bevy_rapier2d::prelude::*;
56

67
/// Note: This will end up in duplication for testbed, but that's more simple.
@@ -14,24 +15,23 @@ fn main() {
1415
0xFF as f32 / 255.0,
1516
)))
1617
.add_plugins((
17-
DefaultPlugins,
18+
MinimalPlugins,
1819
RapierPhysicsPlugin::<NoUserData>::pixels_per_meter(100.0),
19-
RapierDebugRenderPlugin::default(),
2020
))
21-
.add_systems(Startup, (joints2::setup_graphics, joints2::setup_physics))
21+
.add_systems(Startup, joints2::setup_physics)
2222
.add_systems(PostUpdate, print_physics)
2323
.add_systems(Last, quit)
2424
.run();
2525
}
2626

2727
pub fn print_physics(context: Res<RapierContext>) {
2828
#[cfg(feature = "serde-serialize")]
29-
info!(
29+
println!(
3030
"{}",
3131
serde_json::to_string_pretty(&(*context)).expect("Unable to serialize `RapierContext`")
3232
);
3333
#[cfg(not(feature = "serde-serialize"))]
34-
error!("Example 'serialization' should be run with '--features serde-serialize'.");
34+
panic!("Example 'serialization' should be run with '--features serde-serialize'.");
3535
}
3636

3737
fn quit(mut exit_event: EventWriter<AppExit>) {

0 commit comments

Comments
 (0)