single global observers root node (#25)
plus auto name observer macro `global_observer`
This commit is contained in:
@@ -4,6 +4,7 @@ use crate::{
|
||||
GameState,
|
||||
abilities::HeadAbility,
|
||||
backpack::{BackbackSwapEvent, Backpack},
|
||||
global_observer,
|
||||
hitpoints::Hitpoints,
|
||||
player::{Player, head_id_to_str},
|
||||
sounds::PlaySound,
|
||||
@@ -133,8 +134,8 @@ pub fn plugin(app: &mut App) {
|
||||
(reload, sync_hp).run_if(in_state(GameState::Playing)),
|
||||
);
|
||||
|
||||
app.add_observer(on_select_active_head);
|
||||
app.add_observer(on_swap_backpack);
|
||||
global_observer!(app, on_select_active_head);
|
||||
global_observer!(app, on_swap_backpack);
|
||||
}
|
||||
|
||||
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
|
||||
|
||||
Reference in New Issue
Block a user