mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
Exclusive systems can now be used for one-shot systems (#11560)
Joy notified me that exclusive systems should now work (they may have always worked, I don't know), so here's a quick change to the documentation.
This commit is contained in:
parent
7da144bc3d
commit
a955d65ffa
1 changed files with 11 additions and 2 deletions
|
@ -145,7 +145,6 @@ impl World {
|
|||
/// # Limitations
|
||||
///
|
||||
/// - Stored systems cannot be recursive, they cannot call themselves through [`Commands::run_system`](crate::system::Commands).
|
||||
/// - Exclusive systems cannot be used.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
@ -239,7 +238,6 @@ impl World {
|
|||
/// # Limitations
|
||||
///
|
||||
/// - Stored systems cannot be recursive, they cannot call themselves through [`Commands::run_system`](crate::system::Commands).
|
||||
/// - Exclusive systems cannot be used.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
@ -505,6 +503,17 @@ mod tests {
|
|||
assert_eq!(output, NonCopy(3));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn exclusive_system() {
|
||||
let mut world = World::new();
|
||||
let exclusive_system_id = world.register_system(|world: &mut World| {
|
||||
world.spawn_empty();
|
||||
});
|
||||
let entity_count = world.entities.len();
|
||||
let _ = world.run_system(exclusive_system_id);
|
||||
assert_eq!(world.entities.len(), entity_count + 1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_systems() {
|
||||
use crate::system::SystemId;
|
||||
|
|
Loading…
Reference in a new issue