fn game_exit(
  mut commands: Commands,
  old_entities: Query<Entity, Or<(With<MemoryWindowState>, With<SpellViewerState>)>>,
) {
  for e in old_entities.iter() {
    commands.entity(e).despawn_recursive();
  }
}
/// removes a few misc components when we transition from game to menu
removes a few misc components when we transition from game to menu
removes a few misc components when we transition from game to menu
fn game_exit(
  mut commands: Commands,
  old_entities: Query<Entity, Or<(With<MemoryWindowState>, With<SpellViewerState>)>>,
) {
  for e in old_entities.iter() {
    commands.entity(e).despawn_recursive();
  }
}
fn game_exit ( mut commands : Commands , old_entities : Query < Entity , Or < ( With < MemoryWindowState > , With < SpellViewerState > ) > > , ) { for e in old_entities . iter ( ) { commands . entity ( e ) . despawn_recursive ( ) ; } }
removes a few misc components when we transition from game to menu
removes a few misc components when we transition from game to menu
commands
Commands
old_entities
Query<Entity, Or<(With<MemoryWindowState>, With<SpellViewerState>)>>
commands
Commands
old_entities
Query<Entity, Or<(With<MemoryWindowState>, With<SpellViewerState>)>>