Skip to content

Commit

Permalink
add doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobhellermann committed Mar 21, 2021
1 parent e984b04 commit 285658c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/bevy_ecs/src/component/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,17 @@ impl ComponentTicks {
check_tick(&mut self.changed, change_tick);
}

/// Manually sets the change tick.
/// Usually, this is manually done via the [`Deref`](std::ops::Deref) 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 = todo!();
/// let component_ticks: ComponentTicks = todo!();
///
/// component_ticks.set_changed(world.read_change_tick());
/// ```
#[inline]
pub fn set_changed(&mut self, change_tick: u32) {
self.changed = change_tick;
Expand Down

0 comments on commit 285658c

Please sign in to comment.