Replies: 2 comments 2 replies
-
Yes, although it would require support from bevy, or a custom type data: bevyengine/bevy#18511
Haven't thought about that, but it may be possible to register script systems as observer systems. It looks like bevy uses
You can already do this via the |
Beta Was this translation helpful? Give feedback.
-
Is this necessary to support just event types that implement I played around with adding some kind of
Thanks, I think |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been playing around with BMS for a couple of weeks. It pretty impressive!
As far as I can tell, the only way to handle events is via
ScriptCallbackEvent
+event_handler::<OnEvent, LuaScriptingPlugin>
. This works, but is fairly boilerplate heavy on the rust side, needing two sets of event registration types/code, and relatively opinionated sinceevent_handler
handles the dispatch in a specific way. Are there plans to make event handling more inline with bevy in the future? Specifically:EventReader<E>
/EventWriter<E>
Being able to use
EventReader
andEventWriter
natively from script systems viasystem_builder
. A cache/performance friendly way to handle lots of the same kind of event. Theoretically, no BMS specific registrations or boilerplate needed.Trigger<E>
Being able to use
Trigger<E>
natively from script systems viasystem_builder
. Theoretically, no BMS specific registrations or boilerplate needed.ScriptCallbackEvent
-like dispatchAn easy way to manually dispatch a script event handler. Basically what
event_handler
already does, just for a single event. Maybe this can even be abstracted to easily dispatch any script function by name, where event handling is just one use case.Note: I'm using the pre-v0.17 bevy event/trigger terms.
Beta Was this translation helpful? Give feedback.
All reactions