zuma-like/src/states/game/systems.rs

16 lines
544 B
Rust
Raw Normal View History

2026-04-10 20:28:55 +03:00
use bevy::prelude::*;
use crate::states::AppState;
use crate::states::game::components::GameRestart;
pub fn restart_game_button_system(
interaction_query: Query<&Interaction, (Changed<Interaction>, With<GameRestart>)>,
mut next_state: ResMut<NextState<AppState>>,
) {
for interaction in &interaction_query {
if matches!(interaction, Interaction::Pressed) {
println!("🔄 Кнопка Restart нажата! Переход в Restarting...");
next_state.set(AppState::GameRestart);
}
}
}