1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Update the edit scene root in time after it is replaced

When changing the type of the edited scene root node, it may be necessary
to update edited scene root in time for the child nodes to work properly.
This commit is contained in:
Rindbee
2022-11-13 14:52:37 +08:00
parent 9f12e7b52d
commit eb74079dfb
4 changed files with 17 additions and 8 deletions

View File

@@ -2468,11 +2468,6 @@ void SceneTreeDock::replace_node(Node *p_node, Node *p_by_node, bool p_keep_prop
}
n->replace_by(newnode, true);
if (n == edited_scene) {
edited_scene = newnode;
EditorNode::get_singleton()->set_edited_scene(newnode);
}
//small hack to make collisionshapes and other kind of nodes to work
for (int i = 0; i < newnode->get_child_count(); i++) {
Node *c = newnode->get_child(i);