fix(game): initialize AiConfig resource in AiPlugin
Register AiConfig alongside AiStateMachine so the resource is available before the perception/state-transition systems read it.
This commit is contained in:
@@ -35,7 +35,8 @@ pub struct AiPlugin;
|
||||
|
||||
impl Plugin for AiPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.init_resource::<AiStateMachine>()
|
||||
app.init_resource::<AiConfig>()
|
||||
.init_resource::<AiStateMachine>()
|
||||
.add_event::<PerceptionEvent>()
|
||||
.add_event::<StateTransition>()
|
||||
// AI spawning systems - run when entering in-game state
|
||||
|
||||
Reference in New Issue
Block a user