-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to have multiple callbacks in a single listener #21
Comments
Me and Xavier will try and tackle this |
I had a discussion on discord about the design of what this would look like: https://discord.com/channels/691052431525675048/1038322714320052304/1209594439832567818 The goal is that when you register a callback, you get a handle to that callback, so you can remove or replace it later. impl<E: EntityEvent> On<E> {
fn remove<E>(&mut self, handle: ListenerHandle<E>):
fn replace<E>(&mut self, handle: ListenerHandle<E>, callback: tbd)
} |
16 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This feature is necessary because there's currently no way to have more than one of a callback of a single type on an entity.
This is usually just a papercut, but it is required in bevy_mod_picking, in order to merge on_click / on_drag etc into a single callback.
In turn, we want to do that in order to handle the ordering of input events correctly„ using bevyengine/bevy#12100
The text was updated successfully, but these errors were encountered: