Making the Godot Editor better for C# projects with the use of Attributes, like how Unity does it!
Custom is the default, but in some cases you may prefer to use Integrated.
- "well integrated" with the default editor.
- Property shows up where expected, as it always does.
- Customization is quite limited.
- "highly customizable"
- doesn't play well with the built in functions
- no animation keying support (YET)
Note that any export variable that does not have an attribute from this plugin will be handled by the default Godot systems. Only use this were you want/need it.
Attibutes in C# are added with [AttributeName]
. For example, the export attribute is what it used for [Export]
variables. I defined a large set of custom attributes that allow for some extra functinality.
Attribute | Params | Description |
---|---|---|
Tooltip | (string) or (string, string, string ...) | loads the text into the tooltip. For custom inspectors, this is full BBCode enabled, integrated is restricted to a few BBCode options. Also if the params option is used, each string is treated as a line and line breaks are inserted between each. |
UseIntegrated | _ | forces use of the integrated |
BottomInspector | _ | forces the editor to use a more vertical display mode. Gives more space for sliders |
ReadOnly | _ | forces the inspector display to make the variable read-only, which prevents making edits while still displaying the value |
CustomLabel | (string) | Uses a custom label for the variable instead of the default name. |
(list is incomplete)
Attributes in GDscript are generated by the plugin by parsing the source code and finding the block of double hash comments. "##" So adding one of these would go as :
## this will be a tooltip
## @label this will be a custom labe;
export var someInt := 1