16 lines
No EOL
544 B
Rust
16 lines
No EOL
544 B
Rust
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);
|
|
}
|
|
}
|
|
} |