Проектная работа - WIP

This commit is contained in:
13 changed files with 149 additions and 225 deletions
+2 -8
View File
@@ -8,11 +8,7 @@ pub fn print_all_entities(mut commands: Commands, query: Query<Entity>) {
}
/// ДЛЯ ОТЛАДКИ - вывод всех сущностей мира по нажатию Enter
pub fn print_all_entities_by_press_enter(
input: Res<ButtonInput<KeyCode>>,
mut commands: Commands,
query: Query<Entity>,
) {
pub fn print_all_entities_by_press_enter(input: Res<ButtonInput<KeyCode>>, mut commands: Commands, query: Query<Entity>) {
if input.just_pressed(KeyCode::Enter) {
for entity in query {
commands.entity(entity).log_components();
@@ -28,9 +24,7 @@ pub struct Grid;
pub fn spawn_grid(commands: &mut Commands) {
use crate::domain::GRID_SIZE;
let grid = commands
.spawn((Grid, Transform::default(), Visibility::default()))
.id();
let grid = commands.spawn((Grid, Transform::default(), Visibility::default())).id();
for x in -20..=20 {
commands.spawn((