Skip to content

Commit 6bae04a

Browse files
authored
Add usage notes for register_component (#18011)
# Objective - Add usage notes for `register_component`, fixes #16447 ## Testing CI
1 parent 172c020 commit 6bae04a

File tree

1 file changed

+4
-0
lines changed
  • crates/bevy_ecs/src/world

1 file changed

+4
-0
lines changed

crates/bevy_ecs/src/world/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ impl World {
247247
}
248248

249249
/// Registers a new [`Component`] type and returns the [`ComponentId`] created for it.
250+
///
251+
/// # Usage Notes
252+
/// In most cases, you don't need to call this method directly since component registration
253+
/// happens automatically during system initialization.
250254
pub fn register_component<T: Component>(&mut self) -> ComponentId {
251255
self.components.register_component::<T>()
252256
}

0 commit comments

Comments
 (0)