From 98803d4edde8f194fcabcc7caacd84e7763f3b45 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 3 Aug 2023 09:41:48 +0800 Subject: [PATCH] SpatialEditorPlugin should only handle Spatial --- editor/plugins/spatial_editor_plugin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 4daef976e82..e53c1f868db 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -7270,13 +7270,14 @@ void SpatialEditorPlugin::edit(Object *p_object) { } bool SpatialEditorPlugin::handles(Object *p_object) const { - if (p_object->is_class("Spatial") || p_object->is_class("Resource")) { + if (p_object->is_class("Spatial")) { return true; - } else { + } + if (!p_object->is_class("Resource")) { // This ensures that gizmos are cleared when selecting a non-Spatial node. const_cast(this)->edit((Object *)nullptr); - return false; } + return false; } Dictionary SpatialEditorPlugin::get_state() const {