Can't have custom resource type as export variable on a custom class #88
Closed
hmrrrrr
started this conversation in
Is this a bug?
Replies: 1 comment 1 reply
-
What happens when you use a pointer field instead of the struct-by-value? That should work and if not, this would need to be resolved. ie. Res *CustomResource Also, if you would like to contribute a resource demo to the examples repo, then that will record it as a reference and since I run the examples frequently, help ensure the intended behaviour is stable :) In regards to property list, looks like internally this is supported but the PropertyInfo structure needs to be exported. It's a small change and I'll close the issue (if you open one) and also let you know here when it's available (hopefully within the next 24 hours). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I registered the above classes, and I'm able to export the custom resource as an export variable in GDScript and use it just fine:

...but CustomResourceRunner's

Res
field gets exported like this:(trying to edit this dictionary does nothing)
It looks like it's trying to interpret CustomResource as a data struct rather than a Resource. As a workaround I could probably have the exported field as a Resource and then internally store the CustomResource for type safety but was wondering if there's a way to export it correctly like in the example above (something like
Res CustomResource.Instance
??).Let me know if I should open an issue for this.
(Somewhat related, is it possible to override
_get_property_list
? The docs say that it's a method that should be overridden rather than virtual.)Beta Was this translation helpful? Give feedback.
All reactions