aevyrie / bevy_eventlistener

Event listening, bubbling, and callbacks
Apache License 2.0
178 stars 27 forks source link

Support targeting multiple entities #23

Open musjj opened 7 months ago

musjj commented 7 months ago

Some events intrinsically needs to targets multiple entities.

For example collision events will need to be able to report to multiple entities. You can currently simulate this by cloning the event (which can contain lots of data like a vector of manifolds) and sending them to each entity.

I think the ability to natively target multiple entities would help a lot for this kind of use-case.

aevyrie commented 6 months ago

You would need to clone the event regardless. Events need to traverse the hierarchy and can be mutated. If you target two entities, you need two events. If your event is not mutated and you want to avoid cloning it, you can Arc the data.