Clarify Resource change detection behaviour in condition docs (#19252)

# Objective

Fixes https://github.com/bevyengine/bevy/issues/17933

## Solution

Correct "value has changed'" in docs to "value has been added or mutably
dereferenced", with a note for emphasis copied from the docs for
Changed.

## Testing

-
This commit is contained in:
theotherphil 2025-05-30 01:47:25 +01:00 committed by GitHub
parent 6c003ef794
commit 0ee8bf978c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -610,12 +610,11 @@ pub mod common_conditions {
} }
/// A [`SystemCondition`]-satisfying system that returns `true` /// A [`SystemCondition`]-satisfying system that returns `true`
/// if the resource of the given type has had its value changed since the condition /// if the resource of the given type has been added or mutably dereferenced
/// was last checked. /// since the condition was last checked.
/// ///
/// The value is considered changed when it is added. The first time this condition /// **Note** that simply *mutably dereferencing* a resource is considered a change ([`DerefMut`](std::ops::DerefMut)).
/// is checked after the resource was added, it will return `true`. /// Bevy does not compare resources to their previous values.
/// Change detection behaves like this everywhere in Bevy.
/// ///
/// # Panics /// # Panics
/// ///
@ -664,14 +663,11 @@ pub mod common_conditions {
} }
/// A [`SystemCondition`]-satisfying system that returns `true` /// A [`SystemCondition`]-satisfying system that returns `true`
/// if the resource of the given type has had its value changed since the condition /// if the resource of the given type has been added or mutably dereferenced since the condition
/// was last checked. /// was last checked.
/// ///
/// The value is considered changed when it is added. The first time this condition /// **Note** that simply *mutably dereferencing* a resource is considered a change ([`DerefMut`](std::ops::DerefMut)).
/// is checked after the resource was added, it will return `true`. /// Bevy does not compare resources to their previous values.
/// 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. /// The condition will return `false` if the resource does not exist.
/// ///
@ -724,15 +720,11 @@ pub mod common_conditions {
} }
/// A [`SystemCondition`]-satisfying system that returns `true` /// A [`SystemCondition`]-satisfying system that returns `true`
/// if the resource of the given type has had its value changed since the condition /// if the resource of the given type has been added, removed or mutably dereferenced since the condition
/// was last checked. /// was last checked.
/// ///
/// The value is considered changed when it is added. The first time this condition /// **Note** that simply *mutably dereferencing* a resource is considered a change ([`DerefMut`](std::ops::DerefMut)).
/// is checked after the resource was added, it will return `true`. /// Bevy does not compare resources to their previous values.
/// 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. /// The condition will return `false` if the resource does not exist.
/// ///