Skip to content

Commit

Permalink
Init RefreshState for a computed state when it is added
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed May 14, 2024
1 parent 6c469a2 commit 94dd1e3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/bevy_app/src/sub_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ impl SubApp {
.contains_resource::<Events<StateTransitionEvent<S>>>()
{
setup_state_transitions_in_world(&mut self.world, Some(Startup.intern()));
self.init_resource::<RefreshState<S>>();
self.add_event::<StateTransitionEvent<S>>();
let schedule = self.get_schedule_mut(StateTransition).unwrap();
S::register_computed_state_systems(schedule);
Expand Down

0 comments on commit 94dd1e3

Please sign in to comment.