bevy
bevy copied to clipboard
Add `Commands::run_schedule`
Systems (especially observers) should be able to queue the execution of schedules (which are essentially a special kind of exclusive system). It's currently possible to queue the execution of a system through Commands::run_system, but there's no equivalent Commands::run_schedule counterpart for World::run_schedule.
Off the top of my head, I can't think of any technical blockers.
Yeah, this should be trivial to implement. The schedule might fail to run if we're inside the same schedule, but that's normal for World::run_schedule.
Currently you can do (pseudocode) commands.queue(|world| world.run_schedule(...)), but I agree this would make sense as a built-in method.
commands.queue(|world| world.run_schedule(...))
We could make this a lint in bevy_cli to suggest simplifying the invocation.