Fix Alien Cake Addict example despawn warnings (#7236)

# Problem
The example's `teardown` system despawns all entities besides the camera using `despawn_recursive` causing it to despawn child entities multiple times which logs a warning.
![image](https://user-images.githubusercontent.com/29694403/212756554-06b3fa42-ddcb-4a05-b841-f587488a10fc.png)

# Solution
Use `despawn` instead.

Co-authored-by: Devil Ira <justthecooldude@gmail.com>
This commit is contained in:
ira 2023-01-16 20:20:37 +00:00
parent 2f4cf76866
commit 5fd628ebd3

View file

@ -179,7 +179,7 @@ fn setup(mut commands: Commands, asset_server: Res<AssetServer>, mut game: ResMu
// remove all entities that are not a camera
fn teardown(mut commands: Commands, entities: Query<Entity, Without<Camera>>) {
for entity in &entities {
commands.entity(entity).despawn_recursive();
commands.entity(entity).despawn();
}
}