pub fn resource_exists_and_changed<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 does not detect when the resource is removed.

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