make ComponentTicks::set_changed public (#1711)

fixes #1710
This commit is contained in:
Jakob Hellermann 2021-03-22 18:49:26 +00:00
parent 3dc7b685ab
commit 2dd2e5e9fe

View file

@ -340,8 +340,19 @@ impl ComponentTicks {
check_tick(&mut self.changed, change_tick);
}
/// Manually sets the change tick.
/// Usually, this is done automatically via the [`DerefMut`](std::ops::DerefMut) implementation on [`Mut`](crate::world::Mut) or [`ResMut`](crate::system::ResMut) etc.
///
/// # Example
/// ```rust,no_run
/// # use bevy_ecs::{world::World, component::ComponentTicks};
/// let world: World = unimplemented!();
/// let component_ticks: ComponentTicks = unimplemented!();
///
/// component_ticks.set_changed(world.read_change_tick());
/// ```
#[inline]
pub(crate) fn set_changed(&mut self, change_tick: u32) {
pub fn set_changed(&mut self, change_tick: u32) {
self.changed = change_tick;
}
}