mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
parent
3dc7b685ab
commit
2dd2e5e9fe
1 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue