pub fn not<Marker, T>(condition: T) -> impl Condition<()>where
    T: Condition<Marker>,
Expand description

Generates a Condition that inverses the result of passed one.

Example

app.add_system(
    // `not` will inverse any condition you pass in.
    // Since the condition we choose always returns true
    // this system will never run
    my_system.run_if(not(always)),
);

fn my_system(mut counter: ResMut<Counter>) {
    counter.0 += 1;
}

fn always() -> bool {
    true
}

app.run(&mut world);
assert_eq!(world.resource::<Counter>().0, 0);