Class EditorInspectorPlugin
- Namespace
- Godot
- Assembly
- GodotSharpEditor.dll
EditorInspectorPlugin allows adding custom property editors to EditorInspector.
When an object is edited, the _CanHandle(GodotObject) function is called and must return true
if the object type is supported.
If supported, the function _ParseBegin(GodotObject) will be called, allowing to place custom controls at the beginning of the class.
Subsequently, the _ParseCategory(GodotObject, string) and _ParseProperty(GodotObject, Type, string, PropertyHint, string, PropertyUsageFlags, bool) are called for every category and property. They offer the ability to add custom controls to the inspector too.
Finally, _ParseEnd(GodotObject) will be called.
On each of these calls, the "add" functions can be called.
To use EditorInspectorPlugin, register it using the AddInspectorPlugin(EditorInspectorPlugin) method first.
public class EditorInspectorPlugin : RefCounted, IDisposable
- Inheritance
-
EditorInspectorPlugin
- Implements
- Inherited Members
Constructors
EditorInspectorPlugin()
public EditorInspectorPlugin()
Methods
AddCustomControl(Control)
Adds a custom control, which is not necessarily a property editor.
public void AddCustomControl(Control control)
Parameters
control
Control
AddPropertyEditor(string, Control, bool)
Adds a property editor for an individual property. The editor
control must extend EditorProperty.
public void AddPropertyEditor(string property, Control editor, bool addToEnd = false)
Parameters
AddPropertyEditorForMultipleProperties(string, string[], Control)
Adds an editor that allows modifying multiple properties. The editor
control must extend EditorProperty.
public void AddPropertyEditorForMultipleProperties(string label, string[] properties, Control editor)
Parameters
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
_CanHandle(GodotObject)
Returns true
if this object can be handled by this plugin.
public virtual bool _CanHandle(GodotObject @object)
Parameters
object
GodotObject
Returns
_ParseBegin(GodotObject)
Called to allow adding controls at the beginning of the property list for object
.
public virtual void _ParseBegin(GodotObject @object)
Parameters
object
GodotObject
_ParseCategory(GodotObject, string)
Called to allow adding controls at the beginning of a category in the property list for object
.
public virtual void _ParseCategory(GodotObject @object, string category)
Parameters
object
GodotObjectcategory
string
_ParseEnd(GodotObject)
Called to allow adding controls at the end of the property list for object
.
public virtual void _ParseEnd(GodotObject @object)
Parameters
object
GodotObject
_ParseGroup(GodotObject, string)
Called to allow adding controls at the beginning of a group or a sub-group in the property list for object
.
public virtual void _ParseGroup(GodotObject @object, string group)
Parameters
object
GodotObjectgroup
string
_ParseProperty(GodotObject, Type, string, PropertyHint, string, PropertyUsageFlags, bool)
Called to allow adding property-specific editors to the property list for object
. The added editor control must extend EditorProperty. Returning true
removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one.
public virtual bool _ParseProperty(GodotObject @object, Variant.Type type, string name, PropertyHint hintType, string hintString, PropertyUsageFlags usageFlags, bool wide)
Parameters
object
GodotObjecttype
Variant.Typename
stringhintType
PropertyHinthintString
stringusageFlags
PropertyUsageFlagswide
bool