Skip to content

Commit 2dd2e5e

Browse files
make ComponentTicks::set_changed public (#1711)
fixes #1710
1 parent 3dc7b68 commit 2dd2e5e

File tree

1 file changed

+12
-1
lines changed
  • crates/bevy_ecs/src/component

1 file changed

+12
-1
lines changed

crates/bevy_ecs/src/component/mod.rs

+12-1
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,19 @@ impl ComponentTicks {
340340
check_tick(&mut self.changed, change_tick);
341341
}
342342

343+
/// Manually sets the change tick.
344+
/// Usually, this is done automatically via the [`DerefMut`](std::ops::DerefMut) implementation on [`Mut`](crate::world::Mut) or [`ResMut`](crate::system::ResMut) etc.
345+
///
346+
/// # Example
347+
/// ```rust,no_run
348+
/// # use bevy_ecs::{world::World, component::ComponentTicks};
349+
/// let world: World = unimplemented!();
350+
/// let component_ticks: ComponentTicks = unimplemented!();
351+
///
352+
/// component_ticks.set_changed(world.read_change_tick());
353+
/// ```
343354
#[inline]
344-
pub(crate) fn set_changed(&mut self, change_tick: u32) {
355+
pub fn set_changed(&mut self, change_tick: u32) {
345356
self.changed = change_tick;
346357
}
347358
}

0 commit comments

Comments
 (0)