diff --git a/crates/bevy_ecs/src/schedule/config.rs b/crates/bevy_ecs/src/schedule/config.rs index 1c60f5b3da..3ce86039ad 100644 --- a/crates/bevy_ecs/src/schedule/config.rs +++ b/crates/bevy_ecs/src/schedule/config.rs @@ -206,6 +206,39 @@ impl NodeConfigs { } /// Types that can convert into a [`SystemConfigs`]. +/// +/// This trait is implemented for "systems" (functions whose arguments all implement +/// [`SystemParam`](crate::system::SystemParam)), or tuples thereof. +/// It is a common entry point for system configurations. +/// +/// # Examples +/// +/// ``` +/// # use bevy_ecs::schedule::IntoSystemConfigs; +/// # struct AppMock; +/// # struct Update; +/// # impl AppMock { +/// # pub fn add_systems( +/// # &mut self, +/// # schedule: Update, +/// # systems: impl IntoSystemConfigs, +/// # ) -> &mut Self { self } +/// # } +/// # let mut app = AppMock; +/// +/// fn handle_input() {} +/// +/// fn update_camera() {} +/// fn update_character() {} +/// +/// app.add_systems( +/// Update, +/// ( +/// handle_input, +/// (update_camera, update_character).after(handle_input) +/// ) +/// ); +/// ``` pub trait IntoSystemConfigs where Self: Sized, @@ -221,11 +254,17 @@ where } /// Run before all systems in `set`. + /// + /// Note: The given set is not implicitly added to the schedule when this system set is added. + /// It is safe, but no dependencies will be created. fn before(self, set: impl IntoSystemSet) -> SystemConfigs { self.into_configs().before(set) } /// Run after all systems in `set`. + /// + /// Note: The given set is not implicitly added to the schedule when this system set is added. + /// It is safe, but no dependencies will be created. fn after(self, set: impl IntoSystemSet) -> SystemConfigs { self.into_configs().after(set) }