bevy
bevy copied to clipboard
Support `run_if` for SystemConfigs
What problem does this solve or what need does it fill?
Support code like below
.add_systems(
(
a_system,
b_system,
)
.in_base_set(CoreSet::PostUpdate)
.run_if(xxx)
)
2 doesn't work well, since I can't easily implement .run_if for SystemConfigs, as it seems to require cloning Conditions.
From #7634. I want this and looked into implementing it twice, but it's not a completely trivial change.
The issue seems not fixed yet. Below code won't compile
.add_systems(
(check_collision, remove_piece_component)
.in_base_set(CoreSet::PostUpdate)
.distributive_run_if(state_exists_and_equals(GameState::GamePlaying)),
)
From rust doc, closures implement both Copy and Clone if all of the captured variables do. Many common conditions can't be used by distributive_run_if
. Can you reopen this issue for tracking?
This should be moved into milestone 0.11 .