Bevy now has observers, this may be a better approach than change detection on sparse set tag components.
Maybe easier to reason about in selectors?
Instant effects, means no one frame delay
Option 1: Triggers for RunResult (partial adoption)
We could use trigger add/remove systems that run on some query like:
fn add_child_triggers(commands: Commands, parents: Query<&Children, Added<Running>>){
for (parent, children) in parents.iter(){
for child in children{
commands.entity(parent).add_trigger::<RunResult>(child)
}
}
}
And i suppose something similar when it stops running..
Option 2: Triggers for RunResult and Running
Whenever children are added to a parent:
the child observes the parent 'StopRunning' and also stops running as a result
the parent observes the child 'StopRunning' and makes some decision or bubbles it up..
the parent can trigger 'StartRunning' on the child
Bevy now has observers, this may be a better approach than change detection on sparse set tag components.
Option 1: Triggers for
RunResult
(partial adoption)We could use trigger add/remove systems that run on some query like:
And i suppose something similar when it stops running..
Option 2: Triggers for
RunResult
andRunning
Whenever children are added to a parent: