mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
parent
bfbcd47725
commit
708535536b
2 changed files with 6 additions and 1 deletions
|
@ -321,7 +321,7 @@ impl<'w, 's> Commands<'w, 's> {
|
|||
/// if let Some(mut entity_commands) = commands.get_entity(entity) {
|
||||
/// // adds a single component to the entity
|
||||
/// entity_commands.insert(Label("hello world"));
|
||||
/// }
|
||||
/// }
|
||||
/// }
|
||||
/// # bevy_ecs::system::assert_is_system(example_system);
|
||||
/// ```
|
||||
|
@ -565,6 +565,8 @@ impl<'w, 's, 'a> EntityCommands<'w, 's, 'a> {
|
|||
|
||||
/// Adds a [`Bundle`] of components to the entity.
|
||||
///
|
||||
/// This will overwrite any previous value(s) of the same component type.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// The command will panic when applied if the associated entity does not exist.
|
||||
|
|
|
@ -246,6 +246,9 @@ impl<'w> EntityMut<'w> {
|
|||
self.insert(bundle)
|
||||
}
|
||||
|
||||
/// Adds a [`Bundle`] of components to the entity.
|
||||
///
|
||||
/// This will overwrite any previous value(s) of the same component type.
|
||||
pub fn insert<T: Bundle>(&mut self, bundle: T) -> &mut Self {
|
||||
let change_tick = self.world.change_tick();
|
||||
let bundle_info = self
|
||||
|
|
Loading…
Reference in a new issue