1
0
Fork 0

Merge pull request #12994 from vnen/plugin-resource-save

Make resources edited by plugins be sent as reference (2.1)
This commit is contained in:
Rémi Verschelde 2017-11-17 19:48:51 +01:00 committed by GitHub
commit 52da15b6fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -176,7 +176,11 @@ void EditorPlugin::make_visible(bool p_visible) {
void EditorPlugin::edit(Object *p_object) {
if (get_script_instance() && get_script_instance()->has_method("edit")) {
get_script_instance()->call("edit", p_object);
if (p_object->is_class("Resource")) {
get_script_instance()->call("edit", Ref<Resource>(Object::cast_to<Resource>(p_object)));
} else {
get_script_instance()->call("edit", p_object);
}
}
}