You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
- The current API docs of `Commands` is very short and is very opaque to newcomers.
## Solution
- Try to explain what it is without requiring knowledge of other parts of `bevy_ecs` like `World` or `SystemParam`.
Co-authored-by: Charles <[email protected]>
/// A list of commands that modify a [`World`], running at the end of the stage where they
21
-
/// have been invoked.
20
+
/// A list of commands that runs at the end of the stage of the system that called them.
21
+
///
22
+
/// Commands are executed one at a time in an exclusive fashion.
23
+
//// Each command can be used to modify the [`World`] in arbitrary ways:
24
+
/// * spawning or despawning entities
25
+
/// * inserting components on new or existing entities
26
+
/// * inserting resources
27
+
/// * etc.
22
28
///
23
29
/// # Usage
24
30
///
25
-
/// `Commands` is a [`SystemParam`](crate::system::SystemParam), therefore it is declared
26
-
/// as a function parameter:
31
+
/// Add `mut commands: Commands` as a function argument to your system to get a copy of this struct that will be applied at the end of the current stage.
32
+
/// Commands are almost always used as a [`SystemParam`](crate::system::SystemParam).
0 commit comments