Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/bevy_mod_scripting_core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ pub enum Recipients {
Script(ScriptId),
/// The event is to be handled by all the scripts on the specified entity
Entity(Entity),
/// The event is to be handled by all the scripts of one language
Language(crate::asset::Language),
}

/// A callback event meant to trigger a callback in a subset/set of scripts in the world with the given arguments
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_mod_scripting_core/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ pub(crate) fn event_handler_internal<L: IntoCallbackLabel, P: IntoScriptPluginPa
crate::event::Recipients::Entity(target_entity) if target_entity != entity => {
continue
}
crate::event::Recipients::Language(target_language)
if *target_language != P::LANGUAGE =>
{
continue
}
_ => (),
}
let script = match res_ctxt.scripts.scripts.get(script_id) {
Expand Down
Loading