mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
GDScript: Enable exporting nodes to the inspector
Also fix an small issue in the property editor for NodePath trying to use the meta property when not needed.
This commit is contained in:
parent
c41e4b10c3
commit
9490146a16
2 changed files with 11 additions and 3 deletions
|
@ -3605,8 +3605,12 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node
|
|||
variable->export_info.type = Variant::OBJECT;
|
||||
variable->export_info.hint = PROPERTY_HINT_RESOURCE_TYPE;
|
||||
variable->export_info.hint_string = export_type.native_type;
|
||||
} else if (ClassDB::is_parent_class(export_type.native_type, SNAME("Node"))) {
|
||||
variable->export_info.type = Variant::OBJECT;
|
||||
variable->export_info.hint = PROPERTY_HINT_NODE_TYPE;
|
||||
variable->export_info.hint_string = export_type.native_type;
|
||||
} else {
|
||||
push_error(R"(Export type can only be built-in, a resource, or an enum.)", variable);
|
||||
push_error(R"(Export type can only be built-in, a resource, a node, or an enum.)", variable);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue