diff --git a/crates/bevy_ecs/src/schedule/condition.rs b/crates/bevy_ecs/src/schedule/condition.rs index 92bd416300..4212e1be17 100644 --- a/crates/bevy_ecs/src/schedule/condition.rs +++ b/crates/bevy_ecs/src/schedule/condition.rs @@ -13,6 +13,22 @@ pub type BoxedCondition = Box>; /// Implemented for functions and closures that convert into [`System`](crate::system::System) /// with [read-only](crate::system::ReadOnlySystemParam) parameters. /// +/// # Marker type parameter +/// +/// `Condition` trait has `Marker` type parameter, which has no special meaning, +/// but exists to work around the limitation of Rust's trait system. +/// +/// Type parameter in return type can be set to `<()>` by calling [`IntoSystem::into_system`], +/// but usually have to be specified when passing a condition to a function. +/// +/// ``` +/// # use bevy_ecs::schedule::Condition; +/// # use bevy_ecs::system::IntoSystem; +/// fn not_condition(a: impl Condition) -> impl Condition<()> { +/// IntoSystem::into_system(a.map(|x| !x)) +/// } +/// ``` +/// /// # Examples /// A condition that returns true every other time it's called. /// ```