single global observers root node (#25)
plus auto name observer macro `global_observer`
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use super::{BackbackSwapEvent, Backpack, UiHeadState};
|
||||
use crate::{GameState, heads::HeadsImages, loading_assets::UIAssets, sounds::PlaySound};
|
||||
use crate::{
|
||||
GameState, global_observer, heads::HeadsImages, loading_assets::UIAssets, sounds::PlaySound,
|
||||
};
|
||||
use bevy::prelude::*;
|
||||
|
||||
static HEAD_SLOTS: usize = 5;
|
||||
@@ -51,7 +53,7 @@ pub fn plugin(app: &mut App) {
|
||||
.run_if(in_state(GameState::Playing)),
|
||||
);
|
||||
|
||||
app.add_observer(swap_head_inputs);
|
||||
global_observer!(app, swap_head_inputs);
|
||||
}
|
||||
|
||||
fn setup(mut commands: Commands, assets: Res<UIAssets>) {
|
||||
|
||||
Reference in New Issue
Block a user