Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scene: only update components for entities in scene #1023

Merged
merged 1 commit into from
Dec 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions crates/bevy_reflect/src/impls/bevy_ecs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down