Skip to content

Commit 299dee5

Browse files
committed
Make WireframeConfig be a init resource in the sample
1 parent 851310e commit 299dee5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

examples/3d/wireframe.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ fn main() {
1212
..default()
1313
})
1414
.add_plugins(DefaultPlugins)
15+
.insert_resource(WireframeConfig {
16+
// To draw the wireframe on all entities, set this to 'true'
17+
on_all_meshes: false,
18+
// You can also change the default color of the wireframes, which controls:
19+
// - all wireframes if `WireframeConfig::on_all_meshes` is set to 'true'
20+
// - the wireframe of all entities whose `Wireframe::color` is None otherwise
21+
default_color: Color::AQUAMARINE,
22+
})
1523
.add_plugin(WireframePlugin)
1624
.add_startup_system(setup)
1725
.run();
@@ -20,17 +28,9 @@ fn main() {
2028
/// set up a simple 3D scene
2129
fn setup(
2230
mut commands: Commands,
23-
mut wireframe_config: ResMut<WireframeConfig>,
2431
mut meshes: ResMut<Assets<Mesh>>,
2532
mut materials: ResMut<Assets<StandardMaterial>>,
2633
) {
27-
// To draw the wireframe on all entities, set this to 'true'
28-
wireframe_config.on_all_meshes = false;
29-
// You can also change the default color of the wireframes, which controls:
30-
// - all wireframes if `WireframeConfig::on_all_meshes` is set to 'true'
31-
// - the wireframe of all entities whose `Wireframe::color` is None otherwise
32-
wireframe_config.default_color = Color::AQUAMARINE;
33-
3434
// plane
3535
commands.spawn_bundle(PbrBundle {
3636
mesh: meshes.add(Mesh::from(shape::Plane { size: 5.0 })),

0 commit comments

Comments
 (0)