mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
only update components for entities in map (#1023)
This commit is contained in:
parent
19c4f331ac
commit
c54179b182
1 changed files with 4 additions and 2 deletions
|
@ -202,8 +202,10 @@ impl<C: Component + MapEntities> FromType<C> for ReflectMapEntities {
|
|||
fn from_type() -> Self {
|
||||
ReflectMapEntities {
|
||||
map_entities: |world, entity_map| {
|
||||
for mut component in &mut world.query_mut::<&mut C>() {
|
||||
component.map_entities(entity_map)?;
|
||||
for entity in entity_map.values() {
|
||||
if let Ok(mut component) = world.get_mut::<C>(entity) {
|
||||
component.map_entities(entity_map)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue