Compare commits

..

No commits in common. "0a28702b2ae791b54b05d2db9ad9cf0d1d3f19d5" and "aeb80394633b5c9de27fb58765d7f5a41ff58a96" have entirely different histories.

View File

@ -220,8 +220,8 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
let position =
Isometry2::new(Vector2::new(room.center().x(), room.center().y()), 0.);
let aabb = shape.raw.compute_aabb(&position);
commands.entity(map_entity).with_children(|parent| {
parent.spawn((
let id = commands
.spawn((
TransformBundle::from_transform(Transform::from_xyz(
position.translation.x,
position.translation.y,
@ -232,8 +232,9 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
ActiveEvents::COLLISION_EVENTS,
Area(aabb),
Zone,
));
});
))
.id();
commands.entity(map_entity).push_children(&[id]);
}
}
}
@ -279,12 +280,13 @@ fn spawn_portals<D: 'static + Clone + Default + Send + Sync>(
}
}
for (x, y) in portals {
commands.entity(map_entity).with_children(|parent| {
parent.spawn(PortalBundle {
let portal = commands
.spawn(PortalBundle {
transform: Transform::from_translation(Vec3::new(x, y, 0.)),
..default()
});
});
})
.id();
commands.entity(map_entity).push_children(&[portal]);
}
}
}