chore: remove unneeded system

Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
Schmarni
2025-10-31 07:45:25 +01:00
parent 8ab891edb5
commit 94630c451a

View File

@@ -30,11 +30,7 @@ impl Plugin for SpatialNodePlugin {
fn build(&self, app: &mut App) {
app.add_systems(
PostUpdate,
(
spawn_spatial_nodes,
despawn_unneeded_spatial_nodes,
update_spatial_nodes,
)
(spawn_spatial_nodes, update_spatial_nodes)
.chain()
.before(TransformSystem::TransformPropagate),
);
@@ -54,14 +50,6 @@ fn spawn_spatial_nodes(mut cmds: Commands) {
}
}
fn despawn_unneeded_spatial_nodes(query: Query<(Entity, &SpatialNode)>, cmds: ParallelCommands) {
query.par_iter().for_each(|(entity, spatial_node)| {
if spatial_node.0.upgrade().is_none() {
cmds.command_scope(|mut cmds| cmds.entity(entity).despawn());
}
});
}
fn update_spatial_nodes(
mut query: Query<(&mut BevyTransform, &mut Visibility, Option<&ChildOf>)>,
mut cmds: Commands,