Browse Source

Use relative node path when assigning a node on inspector

volzhs 7 năm trước cách đây
mục cha
commit
70e04ae26f
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      editor/editor_properties.cpp

+ 2 - 1
editor/editor_properties.cpp

@@ -1522,7 +1522,8 @@ EditorPropertyColor::EditorPropertyColor() {
 
 
 void EditorPropertyNodePath::_node_selected(const NodePath &p_path) {
 void EditorPropertyNodePath::_node_selected(const NodePath &p_path) {
 
 
-	emit_signal("property_changed", get_edited_property(), p_path);
+	Node *base_node = Object::cast_to<Node>(get_edited_object());
+	emit_signal("property_changed", get_edited_property(), base_node->get_path().rel_path_to(p_path));
 	update_property();
 	update_property();
 }
 }