Unseal ExportAttribute
C# Class
#7120
Closed
QueenOfSquiggles
started this conversation in
Scripting
Replies: 2 comments
-
In short, the attributes were sealed because inheriting would have no effect. Godot's source generators only look for the exact class. Since derived attributes would have no effect and this would be confusing we decided to prevent it entirely. This could allow us to unseal them in the future without breaking compatibility, but that's unlikely to happen. Instead, we'd like to explore different ways of extending Godot's source generators to potentially create custom export attributes. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
ExportAttribute
class is marked as sealed as of 4.1 beta 2. If the class was unsealed, I could add in my own extensions which would serve some usability to exports.For example, I want to make a class of
ExportRangeAttribute
which extendsExportAttribute
. And instead of directly taking in aPropertyHint
andstring
input, I could have it properly implement the float values and greater or less than flags, then build that into a string that gets given to the super class.This is of course assuming that child classes of
ExportAttribute
would be compatible with whatever system Godot uses to export from C# scripts.Beta Was this translation helpful? Give feedback.
All reactions