diff --git a/crates/core/src/schedule.rs b/crates/core/src/schedule.rs index acab2f30e..41e5b6769 100644 --- a/crates/core/src/schedule.rs +++ b/crates/core/src/schedule.rs @@ -6,15 +6,17 @@ pub struct GameSchedulesPlugin; impl Plugin for GameSchedulesPlugin { fn build(&self, app: &mut App) { - let mut main = app.world.get_resource_mut::().unwrap(); - - main.insert_after(First, InputSchedule); - main.insert_after(InputSchedule, PreMovement); - main.insert_after(PreMovement, Movement); - main.insert_after(Movement, PostMovement); + app.add_systems(Startup, setup); } } +fn setup(mut main: ResMut) { + main.insert_after(First, InputSchedule); + main.insert_after(InputSchedule, PreMovement); + main.insert_after(PreMovement, Movement); + main.insert_after(Movement, PostMovement); +} + /// All user input is handled during this schedule. #[derive(ScheduleLabel, Clone, Debug, PartialEq, Eq, Hash)] pub struct InputSchedule;