From db1f0ffdec5830428afbe62358c25a6a72416aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Pakalns?= Date: Wed, 15 Oct 2025 19:23:20 +0300 Subject: [PATCH] Add TextInputDispatch plugin only when it is not already added --- src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7e186a5..27ecd28 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,8 +47,11 @@ pub struct TextInputPlugin; impl Plugin for TextInputPlugin { fn build(&self, app: &mut bevy::app::App) { + if !app.is_plugin_added::() { + app.add_plugins(bevy::input_focus::InputDispatchPlugin); + } + app.add_message::() - .add_plugins(bevy::input_focus::InputDispatchPlugin) .init_resource::() .init_resource::() .init_resource::()