bevy/examples/ecs
JoJoJet 5a5125671b Deprecate ChangeTrackers<T> in favor of Ref<T> (#7306)
# Objective

`ChangeTrackers<>` is a `WorldQuery` type that lets you access the change ticks for a component. #7097 has added `Ref<>`, which gives access to a component's value in addition to its change ticks. Since bevy's access model does not separate a component's value from its change ticks, there is no benefit to using `ChangeTrackers<T>` over `Ref<T>`.

## Solution

Deprecate `ChangeTrackers<>`.

---

## Changelog

* `ChangeTrackers<T>` has been deprecated. It will be removed in Bevy 0.11.

## Migration Guide

`ChangeTrackers<T>` has been deprecated, and will be removed in the next release. Any usage should be replaced with `Ref<T>`.

```rust
// Before (0.9)
fn my_system(q: Query<(&MyComponent, ChangeTrackers<MyComponent>)>) {
    for (value, trackers) in &q {
        if trackers.is_changed() {
            // Do something with `value`.
        }
    }
}

// After (0.10)
fn my_system(q: Query<Ref<MyComponent>>) {
    for value in &q {
        if value.is_changed() {
            // Do something with `value`.
        }
    }
}
```
2023-02-19 16:19:56 +00:00
..
component_change_detection.rs Deprecate ChangeTrackers<T> in favor of Ref<T> (#7306) 2023-02-19 16:19:56 +00:00
custom_query_param.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
ecs_guide.rs Fix panics in ecs_guide example (#7525) 2023-02-08 23:01:53 +00:00
event.rs Replace the bool argument of Timer with TimerMode (#6247) 2022-10-17 13:47:01 +00:00
fixed_timestep.rs Migrate engine to Schedule v3 (#7267) 2023-02-06 02:04:50 +00:00
generic_system.rs Remove .on_update method to improve API consistency and clarity (#7667) 2023-02-14 00:13:10 +00:00
hierarchy.rs Base Sets (#7466) 2023-02-06 03:10:08 +00:00
iter_combinations.rs Base Sets (#7466) 2023-02-06 03:10:08 +00:00
nondeterministic_system_order.rs Cleanup ScheduleBuildSettings (#7721) 2023-02-17 15:17:52 +00:00
parallel_query.rs Base Sets (#7466) 2023-02-06 03:10:08 +00:00
removal_detection.rs Base Sets (#7466) 2023-02-06 03:10:08 +00:00
run_conditions.rs Add example for run conditions (#7652) 2023-02-18 05:32:59 +00:00
startup_system.rs Doc/module style doc blocks for examples (#4438) 2022-05-16 13:53:20 +00:00
state.rs Fixed a typo in an example state.rs (#7666) 2023-02-14 01:16:33 +00:00
system_closure.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
system_param.rs Spawn now takes a Bundle (#6054) 2022-09-23 19:55:54 +00:00
system_piping.rs Remove Anyhow::Result in system_piping.rs example (#7657) 2023-02-14 03:33:47 +00:00
timers.rs Replace the bool argument of Timer with TimerMode (#6247) 2022-10-17 13:47:01 +00:00