mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
5a5125671b
# 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`. } } } ``` |
||
---|---|---|
.. | ||
component_change_detection.rs | ||
custom_query_param.rs | ||
ecs_guide.rs | ||
event.rs | ||
fixed_timestep.rs | ||
generic_system.rs | ||
hierarchy.rs | ||
iter_combinations.rs | ||
nondeterministic_system_order.rs | ||
parallel_query.rs | ||
removal_detection.rs | ||
run_conditions.rs | ||
startup_system.rs | ||
state.rs | ||
system_closure.rs | ||
system_param.rs | ||
system_piping.rs | ||
timers.rs |