Skip to content

Commit 0d5ee87

Browse files
add doc comment
1 parent e984b04 commit 0d5ee87

File tree

1 file changed

+11
-0
lines changed
  • crates/bevy_ecs/src/component

1 file changed

+11
-0
lines changed

crates/bevy_ecs/src/component/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ 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 [`Deref`](std::ops::Deref) 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 = todo!();
350+
/// let component_ticks: ComponentTicks = todo!();
351+
///
352+
/// component_ticks.set_changed(world.read_change_tick());
353+
/// ```
343354
#[inline]
344355
pub fn set_changed(&mut self, change_tick: u32) {
345356
self.changed = change_tick;

0 commit comments

Comments
 (0)