more efficient(?) collider hiding

This commit is contained in:
yuni 2024-04-23 17:43:44 +02:00
parent 9c4167f6e9
commit e7df73d4fc

View file

@ -727,19 +727,10 @@ fn spawn_entities(
}
}
pub fn hide_colliders(
//mut commands: Commands,
mut q_mesh: Query<(&mut Visibility, &Name), With<Handle<Mesh>>>,
//q_flag: Query<Entity, With<NeedsSceneColliderRemoved>>,
) {
pub fn hide_colliders(mut q_mesh: Query<(&mut Visibility, &Name), (Added<Visibility>, With<Handle<Mesh>>)>) {
for (mut visibility, name) in &mut q_mesh {
if name.as_str() == "Collider" {
*visibility = Visibility::Hidden;
}
}
// TODO: not quite done here yet...
// for entity in &q_flag {
// commands.entity(entity).remove::<NeedsSceneColliderRemoved>();
// }
}