|
@@ -614,7 +614,8 @@ bool EditorPropertyArray::_is_drop_valid(const Dictionary &p_drag_data) const {
|
|
|
ERR_FAIL_NULL_V_MSG(dropped_node, false, "Could not get the dropped node by its path.");
|
|
|
|
|
|
if (allowed_type != "NodePath") {
|
|
|
- if (!ClassDB::is_parent_class(dropped_node->get_class_name(), allowed_type)) {
|
|
|
+ if (!ClassDB::is_parent_class(dropped_node->get_class_name(), allowed_type) &&
|
|
|
+ !EditorNode::get_singleton()->is_object_of_custom_type(dropped_node, allowed_type)) {
|
|
|
// Fail if one of the nodes is not of allowed type.
|
|
|
return false;
|
|
|
}
|
|
@@ -625,7 +626,8 @@ bool EditorPropertyArray::_is_drop_valid(const Dictionary &p_drag_data) const {
|
|
|
if (!allowed_subtype_array.has(dropped_node->get_class_name())) {
|
|
|
// The dropped node type was not found in the allowed subtype array, we must check if it inherits one of them.
|
|
|
for (const String &ast : allowed_subtype_array) {
|
|
|
- if (ClassDB::is_parent_class(dropped_node->get_class_name(), ast)) {
|
|
|
+ if (ClassDB::is_parent_class(dropped_node->get_class_name(), ast) ||
|
|
|
+ EditorNode::get_singleton()->is_object_of_custom_type(dropped_node, ast)) {
|
|
|
is_drop_allowed = true;
|
|
|
break;
|
|
|
} else {
|