Add Zone component on rooms.

This commit is contained in:
Nolan Darilek 2022-07-18 11:52:48 -05:00
parent 95e32b3689
commit 410b07826c

View File

@ -65,6 +65,10 @@ impl Default for SpawnPortals {
} }
} }
#[derive(Default, Component, Clone, Debug, Reflect)]
#[reflect(Component)]
pub struct Zone;
pub trait ITileType { pub trait ITileType {
fn blocks_motion(&self) -> bool; fn blocks_motion(&self) -> bool;
fn blocks_visibility(&self) -> bool; fn blocks_visibility(&self) -> bool;
@ -236,13 +240,13 @@ fn spawn_colliders<D: 'static + Clone + Default + Send + Sync>(
.insert(shape) .insert(shape)
.insert(Sensor) .insert(Sensor)
.insert(ActiveEvents::COLLISION_EVENTS) .insert(ActiveEvents::COLLISION_EVENTS)
.insert(Transform::from_xyz( .insert_bundle(TransformBundle::from_transform(Transform::from_xyz(
position.translation.x, position.translation.x,
position.translation.y, position.translation.y,
0., 0.,
)) )))
.insert(GlobalTransform::default())
.insert(Area(aabb)) .insert(Area(aabb))
.insert(Zone)
.id(); .id();
commands.entity(map_entity).push_children(&[id]); commands.entity(map_entity).push_children(&[id]);
} }