Skip to content

Commit

Permalink
Use more clear description
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur committed Feb 16, 2023
1 parent 24302cc commit 749a42b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/bevy_ecs/src/schedule/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,19 @@ pub mod common_conditions {
/// Generates a [`Condition`](super::Condition)-satisfying closure that returns `true`
/// if there are any entities with the added given component type.
///
/// It's recommended to use this condition only if there is only a few entities
/// with the component `T`. Otherwise this check could be expensive and hold
/// up the executor preventing it from running any systems during the check.
/// Run conditions are evaluated on the main thread, blocking any other systems from running.
/// This run condition is relatively expensive, as it iterates over every entity with this component.
/// As a result, you likely only want to use this run condition when the number of entitities with the component `T` is small.
pub fn any_component_added<T: Component>() -> impl FnMut(Query<(), Added<T>>) -> bool {
move |query: Query<(), Added<T>>| !query.is_empty()
}

/// Generates a [`Condition`](super::Condition)-satisfying closure that returns `true`
/// if there are any entities with the changed given component type.
///
/// It's recommended to use this condition only if there is only a few entities
/// with the component `T`. Otherwise this check could be expensive and hold
/// up the executor preventing it from running any systems during the check.
/// Run conditions are evaluated on the main thread, blocking any other systems from running.
/// This run condition is relatively expensive, as it iterates over every entity with this component.
/// As a result, you likely only want to use this run condition when the number of entitities with the component `T` is small.
pub fn any_component_changed<T: Component>() -> impl FnMut(Query<(), Changed<T>>) -> bool {
move |query: Query<(), Changed<T>>| !query.is_empty()
}
Expand Down

0 comments on commit 749a42b

Please sign in to comment.