Skip to content

Commit

Permalink
Update code after changes of systems api in bevy (#208)
Browse files Browse the repository at this point in the history
Breaking changes were introduced in
bevyengine/bevy#8079
  • Loading branch information
iwek7 authored Mar 23, 2023
1 parent df25ab3 commit 057f3e8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fn main() {
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
.add_plugin(ShapePlugin)
.add_startup_system(setup_system)
.add_systems(Startup, setup_system)
.run();
}

Expand Down
8 changes: 4 additions & 4 deletions examples/dynamic_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ fn main() {
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
.add_plugin(ShapePlugin)
.add_startup_system(setup_system)
.add_system(change_draw_mode_system)
.add_system(change_number_of_sides)
.add_system(rotate_shape_system)
.add_systems(Startup, setup_system)
.add_systems(Update, change_draw_mode_system)
.add_systems(Update, change_number_of_sides)
.add_systems(Update, rotate_shape_system)
.run();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
.add_plugin(ShapePlugin)
.add_startup_system(setup_system)
.add_systems(Startup, setup_system)
.run();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/readme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() {
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
.add_plugin(ShapePlugin)
.add_startup_system(setup_system)
.add_systems(Startup, setup_system)
.run();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/rounded_polygon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
.add_plugin(ShapePlugin)
.add_startup_system(setup_system)
.add_systems(Startup, setup_system)
.run();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fn main() {
.insert_resource(Msaa::Sample4)
.add_plugins(DefaultPlugins)
.add_plugin(ShapePlugin)
.add_startup_system(setup_system)
.add_systems(Startup, setup_system)
.run();
}

Expand Down
15 changes: 8 additions & 7 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ use bevy::{
system::{Query, ResMut, Resource},
},
log::error,
prelude::{Color, CoreSet, Deref, DerefMut, IntoSystemConfig, IntoSystemSetConfig, SystemSet},
prelude::{
Color, Deref, DerefMut, IntoSystemConfigs, IntoSystemSetConfig, PostUpdate, SystemSet,
},
render::{
mesh::{Indices, Mesh},
render_resource::PrimitiveTopology,
Expand All @@ -46,17 +48,16 @@ impl Plugin for ShapePlugin {
app.insert_resource(FillTessellator(fill_tess))
.insert_resource(StrokeTessellator(stroke_tess))
.configure_set(
BuildShapes
.in_base_set(CoreSet::PostUpdate)
.after(bevy::transform::TransformSystem::TransformPropagate),
PostUpdate,
BuildShapes.after(bevy::transform::TransformSystem::TransformPropagate),
)
.add_system(mesh_shapes_system.in_set(BuildShapes))
.add_systems(PostUpdate, mesh_shapes_system.in_set(BuildShapes))
.add_plugin(ShapeMaterialPlugin);
}
}

/// [`SystemLabel`] for the system that builds the meshes for newly-added
/// or changed shapes. Resides in [`PostUpdate`](CoreStage::PostUpdate).
/// [`SystemSet`] for the system that builds the meshes for newly-added
/// or changed shapes. Resides in [`PostUpdate`] schedule.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, SystemSet)]
pub struct BuildShapes;

Expand Down

0 comments on commit 057f3e8

Please sign in to comment.