Expand description
Checks for adding systems to a disallowed schedule.
fixed_update_schedule
: Disallows using theFixedUpdate
schedule.update_schedule
: Disallows using theUpdate
schedule.
§Motivation
Often, projects will prefer certain systems be in either the Update
or FixedUpdate
schedule. These two lints are useful for denying an unwanted schedule throughout entire
modules. For example, a project may deny the Update
schedule in a module that only contains
physics logic, or deny the FixedUpdate
schedule in a module that likewise contains only
rendering code.
§Example
mod physics {
#![warn(bevy::update_schedule)]
fn plugin(app: &mut App) {
// This isn't allowed, use `FixedUpdate` instead!
app.add_systems(Update, my_system);
}
fn my_system() {
// ...
}
}
Use instead:
mod physics {
#![warn(bevy::update_schedule)]
fn plugin(app: &mut App) {
app.add_systems(FixedUpdate, my_system);
}
fn my_system() {
// ...
}
}