diff --git a/crates/bevy_mod_scripting_core/src/event.rs b/crates/bevy_mod_scripting_core/src/event.rs index 6a67fd93ce..5b29554eb8 100644 --- a/crates/bevy_mod_scripting_core/src/event.rs +++ b/crates/bevy_mod_scripting_core/src/event.rs @@ -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 diff --git a/crates/bevy_mod_scripting_core/src/handler.rs b/crates/bevy_mod_scripting_core/src/handler.rs index 2a627c70ca..660154f357 100644 --- a/crates/bevy_mod_scripting_core/src/handler.rs +++ b/crates/bevy_mod_scripting_core/src/handler.rs @@ -129,6 +129,11 @@ pub(crate) fn event_handler_internal { continue } + crate::event::Recipients::Language(target_language) + if *target_language != P::LANGUAGE => + { + continue + } _ => (), } let script = match res_ctxt.scripts.scripts.get(script_id) {