pub fn resource_changed_or_removed<T>() -> impl FnMut(Option<Res<'_, T>>)where
    T: Resource,
Expand description

Generates a Condition-satisfying closure that returns true if the resource of the given type has had its value changed since the condition was last checked.

The value is considered changed when it is added. The first time this condition is checked after the resource was added, it will return true. Change detection behaves like this everywhere in Bevy.

This run condition also detects removal. It will return true if the resource has been removed since the run condition was last checked.

The condition will return false if the resource does not exist.