projectile system
This commit is contained in:
parent
918b4884b2
commit
ad4a2cf393
17 changed files with 400 additions and 23 deletions
|
|
@ -197,14 +197,14 @@ fn place_building(
|
|||
mut building_map: ResMut<PlacedBuildings>,
|
||||
mut commands: Commands,
|
||||
mut resources: ResMut<Resources>,
|
||||
info_query: Query<(&BuildingInfo, &Cost)>,
|
||||
info_query: Query<(&BuildingInfo, &Cost, &Name)>,
|
||||
) {
|
||||
for PlaceBuilding {
|
||||
info: info_entity,
|
||||
location,
|
||||
} in reader.read()
|
||||
{
|
||||
let Ok((info, cost)) = info_query.get(*info_entity) else {
|
||||
let Ok((info, cost, name)) = info_query.get(*info_entity) else {
|
||||
error!("tried to place building without info!");
|
||||
continue;
|
||||
};
|
||||
|
|
@ -228,6 +228,9 @@ fn place_building(
|
|||
BuildingPosition(*location),
|
||||
Collider::cuboid(size_v3.x, size_v3.y, size_v3.z),
|
||||
Mesh3d::default(),
|
||||
name.clone(),
|
||||
RigidBody::Static,
|
||||
Team::Core.collision_layers(),
|
||||
))
|
||||
.id();
|
||||
building_map.place_building(*location, info, *info_entity, instance);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue