Skip to content

Commit e3ad84b

Browse files
committed
Address comments
1 parent fd7500a commit e3ad84b

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

crates/bevy_ecs/src/entity/clone_entities.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl EntityCloner {
420420
pub fn build(world: &mut World) -> EntityClonerBuilder {
421421
EntityClonerBuilder {
422422
world,
423-
attach_required_components: false,
423+
attach_required_components: true,
424424
entity_cloner: EntityCloner::default(),
425425
}
426426
}
@@ -575,8 +575,7 @@ pub struct EntityClonerBuilder<'w> {
575575
}
576576

577577
impl<'w> EntityClonerBuilder<'w> {
578-
/// Internally consumes the builder to construct an [`EntityCloner`], calls [`EntityCloner::clone_entity`] on the
579-
/// builder's [`World`], and returns the resulting [`EntityCloner`].
578+
/// Internally calls [`EntityCloner::clone_entity`] on the builder's [`World`].
580579
pub fn clone_entity(&mut self, source: Entity, target: Entity) -> &mut Self {
581580
self.entity_cloner.clone_entity(self.world, source, target);
582581
self
@@ -737,6 +736,17 @@ impl<'w> EntityClonerBuilder<'w> {
737736
self
738737
}
739738

739+
/// Removes a previously set override of [`ComponentCloneBehavior`] for a given `component_id` in this builder.
740+
pub fn remove_clone_behavior_override_with_id(
741+
&mut self,
742+
component_id: ComponentId,
743+
) -> &mut Self {
744+
self.entity_cloner
745+
.clone_behavior_overrides
746+
.remove(&component_id);
747+
self
748+
}
749+
740750
/// If `true`, makes the built [`EntityCloner`] recursively clone entities, as defined by
741751
/// [`RelationshipTarget::LINKED_SPAWN`](crate::relationship::RelationshipTarget::LINKED_SPAWN).
742752
pub fn recursive(&mut self, is_recursive: bool) -> &mut Self {

0 commit comments

Comments
 (0)