From dce6a9a44086b0676bf27a2ed6c174606ff90899 Mon Sep 17 00:00:00 2001 From: "David M. Lary" Date: Sun, 26 Mar 2023 20:36:41 -0500 Subject: [PATCH 01/25] Add `Schedule.label` Needed a way to identify a `Schedule` by `ScheduleLabel` for stepping. This data wasn't currently stored in the `Schedule`, but only used as a key in the `Schedules` resource. That resource (and key) are not available when stepping is evaluating a `Schedule`, so the label needed to be added. Added `label` to `Schedule`, and updated `add_schedule()` functions to set the label. I would have preferred to implement this as `Schedule::with_label()`, and have `add_schedule()` pull the label directly from `Schedule`, but that's a breaking change for the API. I feel like this is a good compromise as it doesn't break the API, but the data still gets where it needs to be. --- crates/bevy_app/src/app.rs | 6 +++++- crates/bevy_ecs/src/schedule/schedule.rs | 14 ++++++++++++++ crates/bevy_ecs/src/world/mod.rs | 6 +++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index d7a4da63cd1b0..4163a31fff3de 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -875,7 +875,11 @@ impl App { /// # Warning /// This method will overwrite any existing schedule at that label. /// To avoid this behavior, use the `init_schedule` method instead. - pub fn add_schedule(&mut self, label: impl ScheduleLabel, schedule: Schedule) -> &mut Self { + pub fn add_schedule