Table of Contents

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

property string
editor Control
addToEnd bool

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

label string
properties string[]
editor Control

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_name

Name of the method to check for.

Returns

bool

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_name

Name of the signal to check for.

Returns

bool

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_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

_CanHandle(GodotObject)

Returns true if this object can be handled by this plugin.

public virtual bool _CanHandle(GodotObject @object)

Parameters

object GodotObject

Returns

bool

_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 GodotObject
category 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 GodotObject
group 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 GodotObject
type Variant.Type
name string
hintType PropertyHint
hintString string
usageFlags PropertyUsageFlags
wide bool

Returns

bool