bevy
bevy copied to clipboard
Handle TriggerTargets that are combinations for components/entities
Objective
- Fixes https://github.com/bevyengine/bevy/issues/14074
- It is currently not possible to issues a trigger that targets a specific list of components AND a specific list of entities
Solution
- We can now use
((A, B), (entity_1, entity_2))as a trigger target, as well as the reverse
Testing
- Added a unit test. The triggering rules for observers are quite confusing:
- triggers once per entity target
- for each entity target, an observer system triggers if any of its components matches the trigger target components (but it triggers at most once, since we use an internal counter to make sure that an observer can run at most once per entity target)
The triggering rules for observers are quite confusing:
I'd like to see more docs explicitly explaining this.
The triggering rules for observers are quite confusing:
I'd like to see more docs explicitly explaining this.
This should be independent from this PR I think, right? Here i'm just adding the possibility to have more flexible trigger targets
Kind of wondering if we shouldn't cut this from 0.15 for stability.
Adopted in #16326