Table of Contents

Class EditorInspector

Namespace
Godot
Assembly
GodotSharpEditor.dll

This is the control that implements property editing in the editor's Settings dialogs, the Inspector dock, etc. To get the EditorInspector used in the editor's Inspector dock, use GetInspector().

EditorInspector will show properties in the same order as the array returned by GetPropertyList().

If a property's name is path-like (i.e. if it contains forward slashes), EditorInspector will create nested sections for "directories" along the path. For example, if a property is named highlighting/gdscript/node_path_color, it will be shown as "Node Path Color" inside the "GDScript" section nested inside the "Highlighting" section.

If a property has Group usage, it will group subsequent properties whose name starts with the property's hint string. The group ends when a property does not start with that hint string or when a new group starts. An empty group name effectively ends the current group. EditorInspector will create a top-level section for each group. For example, if a property with group usage is named Collide With and its hint string is collide_with_, a subsequent collide_with_area property will be shown as "Area" inside the "Collide With" section. There is also a special case: when the hint string contains the name of a property, that property is grouped too. This is mainly to help grouping properties like font, font_color and font_size (using the hint string font_).

If a property has Subgroup usage, a subgroup will be created in the same way as a group, and a second-level section will be created for each subgroup.

Note: Unlike sections created from path-like property names, EditorInspector won't capitalize the name for sections created from groups. So properties with group usage usually use capitalized names instead of snake_cased names.

public class EditorInspector : ScrollContainer, IDisposable
Inheritance
EditorInspector
Implements
Inherited Members

Constructors

EditorInspector()

public EditorInspector()

Methods

GetEditedObject()

Returns the object currently selected in this inspector.

public GodotObject GetEditedObject()

Returns

GodotObject

GetSelectedPath()

Gets the path of the currently selected property.

public string GetSelectedPath()

Returns

string

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

Events

EditedObjectChanged

Emitted when the object being edited by the inspector has changed.

public event Action EditedObjectChanged

Event Type

Action

ObjectIdSelected

Emitted when the Edit button of an GodotObject has been pressed in the inspector. This is mainly used in the remote scene tree Inspector.

public event EditorInspector.ObjectIdSelectedEventHandler ObjectIdSelected

Event Type

EditorInspector.ObjectIdSelectedEventHandler

PropertyDeleted

Emitted when a property is removed from the inspector.

public event EditorInspector.PropertyDeletedEventHandler PropertyDeleted

Event Type

EditorInspector.PropertyDeletedEventHandler

PropertyEdited

Emitted when a property is edited in the inspector.

public event EditorInspector.PropertyEditedEventHandler PropertyEdited

Event Type

EditorInspector.PropertyEditedEventHandler

PropertyKeyed

Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled.

public event EditorInspector.PropertyKeyedEventHandler PropertyKeyed

Event Type

EditorInspector.PropertyKeyedEventHandler

PropertySelected

Emitted when a property is selected in the inspector.

public event EditorInspector.PropertySelectedEventHandler PropertySelected

Event Type

EditorInspector.PropertySelectedEventHandler

PropertyToggled

Emitted when a boolean property is toggled in the inspector.

Note: This signal is never emitted if the internal autoclear property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself.

public event EditorInspector.PropertyToggledEventHandler PropertyToggled

Event Type

EditorInspector.PropertyToggledEventHandler

ResourceSelected

Emitted when a resource is selected in the inspector.

public event EditorInspector.ResourceSelectedEventHandler ResourceSelected

Event Type

EditorInspector.ResourceSelectedEventHandler

RestartRequested

Emitted when a property that requires a restart to be applied is edited in the inspector. This is only used in the Project Settings and Editor Settings.

public event Action RestartRequested

Event Type

Action