|
1 | 1 | use crate::{First, FixedUpdate, Main, MainSchedulePlugin, Plugin, Plugins, StateTransition}; |
2 | 2 | pub use bevy_derive::AppLabel; |
3 | 3 | use bevy_ecs::{ |
4 | | - event::EventUpdateSignal, |
5 | 4 | prelude::*, |
6 | 5 | schedule::{ |
7 | 6 | apply_state_transition, common_conditions::run_once as run_once_condition, |
@@ -184,6 +183,8 @@ impl Default for App { |
184 | 183 | app.init_resource::<AppTypeRegistry>(); |
185 | 184 |
|
186 | 185 | app.add_plugins(MainSchedulePlugin); |
| 186 | + app.add_systems(FixedUpdate, bevy_ecs::event::event_queue_update_system); |
| 187 | + |
187 | 188 | app.add_event::<AppExit>(); |
188 | 189 |
|
189 | 190 | #[cfg(feature = "bevy_ci_testing")] |
@@ -448,18 +449,11 @@ impl App { |
448 | 449 | T: Event, |
449 | 450 | { |
450 | 451 | if !self.world.contains_resource::<Events<T>>() { |
451 | | - self.init_resource::<Events<T>>() |
452 | | - .init_resource::<EventUpdateSignal<T>>() |
453 | | - .add_systems( |
454 | | - First, |
455 | | - bevy_ecs::event::event_update_system::<T> |
456 | | - .run_if(bevy_ecs::event::event_update_condition::<T>), |
457 | | - ) |
458 | | - .add_systems( |
459 | | - FixedUpdate, |
460 | | - bevy_ecs::event::event_queue_update_system::<T> |
461 | | - .run_if(bevy_ecs::event::event_update_condition::<T>), |
462 | | - ); |
| 452 | + self.init_resource::<Events<T>>().add_systems( |
| 453 | + First, |
| 454 | + bevy_ecs::event::event_update_system::<T> |
| 455 | + .run_if(bevy_ecs::event::event_update_condition::<T>), |
| 456 | + ); |
463 | 457 | } |
464 | 458 | self |
465 | 459 | } |
|
0 commit comments