Export resources written in GDScript to your C# script with the built-in attribute, by default the [Export(PropertyHint.ResourceType, "...")]
will still show all type that can be casted to Resources
. This is especially troublesome when you want to export a resources that are written on GDScript to your C# script, and what this script does. Is that it creates a clone property of the original that actually use this attribute and will refer to the correct type.
GDScript.Resources.to.CSharp.Export.mp4
Your script needs to have the [Tool]
attribute that derives from ResourcesTypeExportWrapper
. This ResourcesTypeExportWrapper
derives from Node
for the purpose of this examples. But you can change it to any type you want. Then you can use the [Export(PropertyHint.ResourceType, "...")]
to your field/property that you want to have the resources on.
This example only provides you the means to export resources written in GDScript to C#. Please refer to the Cross-language scripting documentation if you want to read more about cross scripting.