Merge pull request #80197 from timothyqiu/resource

[3.x] SpatialEditorPlugin should only handle Spatial
This commit is contained in:
Rémi Verschelde 2023-08-03 11:55:56 +02:00 committed by GitHub
commit b776cf5498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -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<SpatialEditorPlugin *>(this)->edit((Object *)nullptr);
return false;
}
return false;
}
Dictionary SpatialEditorPlugin::get_state() const {