diff --git a/content/learn/book/ecs/exclusive-world-access/_index.md b/content/learn/book/ecs/exclusive-world-access/_index.md index 7cd5736000..114c7d9d26 100644 --- a/content/learn/book/ecs/exclusive-world-access/_index.md +++ b/content/learn/book/ecs/exclusive-world-access/_index.md @@ -64,16 +64,15 @@ app_exit_event_writer.send(AppExit); ### Manually running systems -With the help of [`SystemParamFunction::run()](https://docs.rs/bevy/0.5.0/bevy/ecs/system/trait.SystemParamFunction.html#tymethod.run), you can manually run systems of your own! -This can be useful if you want to implement your own, advanced work scheduling in a way that doesn't fit well into a standard stage. +FIXME: verify that https://github.com/bevyengine/bevy/pull/2417 was merged for 0.6. -TODO: add code demonstrating this here. -```rust +If you'd like to use the familiar and expressive system syntax when working with `World`, you can use the [`World::run_system`](https://docs.rs/bevy/0.5.0/bevy/ecs/world/struct.World.html#method.run_system) method to immediately execute one system at a time. +Commands generated by the system are applied immediately after it is executed in this way. -``` +This will generally be less performant than using a standard parallel system stage, +but can offer greater simplicity and control, particularly when prototyping or for non-standard control flows. -Note that this function is `unsafe`: you need to be careful to ensure that your systems are not accessing mutable data in more than one place at once. -Running each of these systems sequentially will ensure this, and is often sufficient for basic applications of this pattern. +It can also be useful for re-using or organizing logic used in other areas where you need exclusive world access, by wrapping it in a safe and well-contained function that is run in a single line. ## Applications of exclusive world access