Add usage notes for register_component
(#18011)
# Objective - Add usage notes for `register_component`, fixes #16447 ## Testing CI
This commit is contained in:
parent
172c020b60
commit
6bae04ab36
@ -247,6 +247,10 @@ impl World {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Registers a new [`Component`] type and returns the [`ComponentId`] created for it.
|
/// Registers a new [`Component`] type and returns the [`ComponentId`] created for it.
|
||||||
|
///
|
||||||
|
/// # Usage Notes
|
||||||
|
/// In most cases, you don't need to call this method directly since component registration
|
||||||
|
/// happens automatically during system initialization.
|
||||||
pub fn register_component<T: Component>(&mut self) -> ComponentId {
|
pub fn register_component<T: Component>(&mut self) -> ComponentId {
|
||||||
self.components.register_component::<T>()
|
self.components.register_component::<T>()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user