Skip to content

Commit

Permalink
Merge pull request #80197 from timothyqiu/resource
Browse files Browse the repository at this point in the history
[3.x] SpatialEditorPlugin should only handle Spatial
  • Loading branch information
akien-mga authored Aug 3, 2023
2 parents 39bbf76 + 98803d4 commit b776cf5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions editor/plugins/spatial_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b776cf5

Please sign in to comment.