chore: remove unneeded system
Signed-off-by: Schmarni <marnistromer@gmail.com>
This commit is contained in:
@@ -30,11 +30,7 @@ impl Plugin for SpatialNodePlugin {
|
|||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.add_systems(
|
app.add_systems(
|
||||||
PostUpdate,
|
PostUpdate,
|
||||||
(
|
(spawn_spatial_nodes, update_spatial_nodes)
|
||||||
spawn_spatial_nodes,
|
|
||||||
despawn_unneeded_spatial_nodes,
|
|
||||||
update_spatial_nodes,
|
|
||||||
)
|
|
||||||
.chain()
|
.chain()
|
||||||
.before(TransformSystem::TransformPropagate),
|
.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(
|
fn update_spatial_nodes(
|
||||||
mut query: Query<(&mut BevyTransform, &mut Visibility, Option<&ChildOf>)>,
|
mut query: Query<(&mut BevyTransform, &mut Visibility, Option<&ChildOf>)>,
|
||||||
mut cmds: Commands,
|
mut cmds: Commands,
|
||||||
|
|||||||
Reference in New Issue
Block a user