Merge branch 'main' into bevy-0.12

This commit is contained in:
Nolan Darilek 2024-03-24 12:22:12 -05:00
commit 0a28702b2a

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