-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Export]ed property doesn't narrow down possible object types to CustomResource type #11
Comments
This is Godot's built in behaviour. This won't be fixed until we get first class support for C# resources. In the mean time, you can assign a class prefix in the settings for this plugin. For example if you assign their prefix as _, all your custom resources will show up first. |
Does it actually show up in the dropdown for you guys? I'm only seeing the custom resources in the file system's New Resource window. |
Uh oh you're right it's missing. We should probably file a bug report on the godot repo. |
I've made the issue here godotengine/godot#75245, although once the C# first class resource support gets added, this plugin will be moot. |
So until that issue is seen to or the C# first class resource support is finally merged (the former seems unlikely given the attention on the latter), our sole option for custom Resources written in C# is to create each instance individually through the filesystem's right click New > Resource menu and drag them into Inspector fields? |
Yeah I guess you can no longer create local custom resources in scenes. Creating resources in the file system should still work. |
I've found a workaround that permits local custom resources, even with their being absent from the new resource dropdown menu:
This will copy the resource's contents into the .tscn file as though it had been created from the dropdown. From there, more local instances can be conveniently created by copying, pasting, and making the pasted resource unique. Thank you for creating this plugin, by the way - it's an important stopgap while the main project works out C# first class resource support. |
If you're dealing with an exported array of custom resources, you can also add the [Tool] attribute and then write a setter property for the array which auto initializes empty elements. This means that when you press the Add Element button, an object will be created automatically. This won't really work for child classes though, unless you write an inspector plugin. |
I've added a custom resource type and [Export]ed it in one of the scripts. When I'm assigning an object it shows me all possible resource types known to the engine
It's the same behaviour as I just make property type in a script as
[Export] Resource myCustomResource
The text was updated successfully, but these errors were encountered: