diff --git a/crates/bevy_ecs/src/component/mod.rs b/crates/bevy_ecs/src/component/mod.rs index 6892c0963f..509d556d82 100644 --- a/crates/bevy_ecs/src/component/mod.rs +++ b/crates/bevy_ecs/src/component/mod.rs @@ -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; } }