Closed
Description
When adding a state after #1675 systems in the same stage get run twice.
use bevy::{app::ScheduleRunnerSettings, prelude::*};
use std::time::Duration;
#[derive(Clone, PartialEq, Eq, Debug, Hash)]
enum AppState { Main }
fn main() {
App::build()
.insert_resource(ScheduleRunnerSettings::run_loop(Duration::from_secs_f32(1.0 / 60.0)))
.add_plugins(MinimalPlugins)
.add_state(AppState::Main)
.add_system(system.system())
.run();
}
fn system() {
println!("<user system runs>");
}
results in the following execution
run stage First
run stage Startup
run stage PreUpdate
run stage Update
<user system runs>
<user system runs>
run stage PostUpdate
run stage Last
Removing the .add_state
or reverting #1675 fixes the issue, i.e. the system gets run only once.
ping @Ratysz