-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
What problem does this solve or what need does it fill?
Creating simple orderings between systems is harder than it should be. Users must define a label, and then use a .before or .after method.
In many cases, we have two (or maybe a few more) systems that need to be linearly ordered, which are defined in the same plugin.
This is both verbose and harder to read / reason about
What solution would you like?
app.add_system_set(system_a.then(system_b))The .then method on IntoSystemDescriptor converts a system function into a SystemSet.
What alternative(s) have you considered?
System set chaining
app.add_system_set(systems![
my_system,
my_other_system
].chain())System graph
We could use a full system graph API, as defined in #2381 (and the bevy_system_graph crate that came out of this).
This is probably too complex and unwieldy for this very simple but common case, but may be desirable later regardless.
add_system .then
Naively, a mechanism that works like the current .chain seems desirable.
app.add_system(system_a.then(my_other_system))Unfortunately, this won't work under the hood: add_system expects a single system.
Additional context
Related to #4219, which proposes additional ergonomics improvements.
We may want to rename add_system_set to add_systems, following the suggestions in the Stageless RFC, to improve ergonomics. This should probably be done in a follow-up PR to improve reviewability.
I also really really want label-less ordering apis
Something like system_a.after(system_b)
would cover like 95% of system ordering use cases
Metadata
Metadata
Assignees
Labels
Type
Projects
Status