From 410b07826ce263973ed54c79b07f71835a28cca9 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Mon, 18 Jul 2022 11:52:48 -0500 Subject: [PATCH] Add `Zone` component on rooms. --- src/map.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/map.rs b/src/map.rs index 9202e98..27d4080 100644 --- a/src/map.rs +++ b/src/map.rs @@ -65,6 +65,10 @@ impl Default for SpawnPortals { } } +#[derive(Default, Component, Clone, Debug, Reflect)] +#[reflect(Component)] +pub struct Zone; + pub trait ITileType { fn blocks_motion(&self) -> bool; fn blocks_visibility(&self) -> bool; @@ -236,13 +240,13 @@ fn spawn_colliders( .insert(shape) .insert(Sensor) .insert(ActiveEvents::COLLISION_EVENTS) - .insert(Transform::from_xyz( + .insert_bundle(TransformBundle::from_transform(Transform::from_xyz( position.translation.x, position.translation.y, 0., - )) - .insert(GlobalTransform::default()) + ))) .insert(Area(aabb)) + .insert(Zone) .id(); commands.entity(map_entity).push_children(&[id]); }