From 2ab12f7af0b6693084e40714884fad732407673e Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Sat, 26 Mar 2022 20:09:41 -0400 Subject: [PATCH] Note limitations --- crates/bevy_ecs/src/system/system_registry.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/bevy_ecs/src/system/system_registry.rs b/crates/bevy_ecs/src/system/system_registry.rs index 1c75a4d507d1ac..6285530b9abfcd 100644 --- a/crates/bevy_ecs/src/system/system_registry.rs +++ b/crates/bevy_ecs/src/system/system_registry.rs @@ -14,7 +14,15 @@ use crate::world::{Mut, World}; /// /// Any [`Commands`](crate::system::Commands) generated by these systems (but not other systems), will immediately be applied. /// -/// Stored systems cannot be chained: they can neither have an [`In`](crate::system::In) nor return any values. +/// This type is stored as a [`Resource`](crate::system::Resource) on each [`World`], initialized by default. +/// However, it will likely be easier to use the corresponding methods on [`World`], +/// to avoid having to worry about split mutable borrows yourself. +/// +/// # Limitations +/// +/// - stored systems cannot be chained: they can neither have an [`In`](crate::system::In) nor return any values. +/// - stored systems cannot recurse: they cannot run other systems via the [`SystemRegistry`] methods on `World` or `Commands`. +/// - exclusive systems cannot be used. /// /// # Examples /// @@ -55,10 +63,6 @@ use crate::world::{Mut, World}; /// for _ in 0..7 { /// commands.spawn().insert(Marker); /// } -/// -/// // You can even run systems via commands, -/// // which will take effect the next time commands are applied -/// commands.run_system(assert_7_spawned) /// } /// /// fn assert_7_spawned(query: Query<(), Added>){ @@ -67,6 +71,7 @@ use crate::world::{Mut, World}; /// } /// /// world.run_system(spawn_7_entities); +/// world.run_system(assert_7_spawned); /// ``` /// /// ```rust