Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve debugging tools for change detection (bevyengine#4160)
# Objective 1. Previously, the `change_tick` and `last_change_tick` fields on `SystemChangeTick` [were `pub`](https://docs.rs/bevy/0.6.1/bevy/ecs/system/struct.SystemChangeTick.html). 1. This was actively misleading, as while this can be fetched as a `SystemParam`, a copy is returned instead 2. This information could be useful for debugging, but there was no way to investigate when data was changed. 3. There were no docs! ## Solution 1. Move these to a getter method. 2. Add `last_changed` method to the `DetectChanges` trait to enable inspection of when data was last changed. 3. Add docs. # Changelog `SystemChangeTick` now provides getter methods for the current and previous change tick, rather than public fields. This can be combined with `DetectChanges::last_changed()` to debug the timing of changes. # Migration guide The `change_tick` and `last_change_tick` fields on `SystemChangeTick` are now private, use the corresponding getter method instead.
- Loading branch information