add player spawn event

This commit is contained in:
TudbuT 2024-11-23 18:22:41 +01:00
parent 44ff56592e
commit a24e6e39a6
2 changed files with 56 additions and 19 deletions

View file

@ -1,7 +1,7 @@
use bevy::prelude::*;
use bevy_rapier2d::prelude::*;
use player::player_plugin;
use scene::scene_plugin;
use scene::{scene_plugin, PlayerSpawnEvent};
use crate::AppState;
@ -12,5 +12,7 @@ mod set;
pub const WORLD_DEPTH: f32 = 0.5;
pub fn game_plugin(app: &mut App) {
app.add_plugins((player_plugin, scene_plugin));
(app)
.add_event::<PlayerSpawnEvent>()
.add_plugins((player_plugin, scene_plugin));
}