Friflo.Engine.ECS
Friflo.Engine.ECS copied to clipboard
[Feature Request] Extend System Groups
I would like to add the ability to specify how many ticks a SystemGroup should run every, similar to Bevy's SystemGroup control.
You can pass the ticks via the struct UpdateTick.
They are passed as parameter of the method SystemGroup.Update(UpdateTick tick).
I you mean something different please show the a Bevy example which illustrates what you want.
use bevy::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
// System A: Runs every 0.5 seconds
.add_systems(Update, fast_system.run_if(on_timer(Duration::from_millis(500))))
// System B: Runs every 1 second
.add_systems(Update, medium_system.run_if(on_timer(Duration::from_secs(1))))
// System C: Runs every 2 seconds
.add_systems(Update, slow_system.run_if(on_timer(Duration::from_secs(2))))
.run();
}
fn fast_system() {
println!(“[FAST] 500ms tick”);
}
fn medium_system() {
println!(“[MEDIUM] 1s tick”);
}
fn slow_system() {
println!(“[SLOW] 2s tick”);
}
Like this, each system can run at different frequencies.