Skip to content

Commit

Permalink
fix: editor reset button share same reference between objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ThakeeNathees committed Jun 9, 2020
1 parent 947a663 commit c6f25f6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion editor/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,14 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) {

Variant default_value = ClassDB::class_get_default_property_value(object->get_class_name(), property);
if (default_value != Variant()) {
emit_changed(property, default_value);
Object *obj = default_value.operator Object *();
Resource *res = Object::cast_to<Resource>(obj);
if (res) {
emit_changed(property, res->duplicate(true));
} else {
emit_changed(property, default_value);
}

update_property();
return;
}
Expand Down

0 comments on commit c6f25f6

Please sign in to comment.