Skip to content
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

C# Export attribute error #76953

Closed
lh472266503 opened this issue May 11, 2023 · 1 comment · Fixed by #76978
Closed

C# Export attribute error #76953

lh472266503 opened this issue May 11, 2023 · 1 comment · Fixed by #76978

Comments

@lh472266503
Copy link

Godot version

v4.1.dev.mono.custom_build [f717cc0]

System information

Windows 10, Vulkan API 1.3.236 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1050 Ti, Intel i5-8300H

Issue description

When I use the "Export" attribute to export variables in C#, regardless of whether they are of type "Node" or "Resource", the creation dialog in the inspector in the editor is always the one for creating a "Resource", and it contains all "Resource" types instead of the matching ones.
@178RCSD21_F0FHMZIUQ{R7
image

Steps to reproduce

"Open the "Test" scene in the "Demo" project, which contains two "Export" variables - one is of type "Texture2D" and the other is of type "Node". Please check and create them in the inspector of the editor interface."

Minimal reproduction project

Demo.zip

@raulsntos
Copy link
Member

This was caused by #69988 when adding a new member to the PropertyHint enum made the PROPERTY_HINT_NODE_TYPE change its value from 34 to 35.

The C# source generator that generates the property info that is retrieved by the inspector is still generating 34 because the enum wasn't updated in the C# side.

This kind of change breaks compatibility, because libraries that were compiled against an older version of GodotSharp will use the old enum values. So I think the fix would be to move the new enum member to the end of the enum to prevent breaking compatibility while we still can before the 4.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants