reckfellENGINE

EditorResourcePicker

Reckfell editor's control for selecting Resource type properties.

On this page
class EditorResourcePickerReckfellSharpEditorInherits HBoxContainer

Reckfell editor's control for selecting Resource type properties.

This Control node is used in the editor's Inspector dock to allow editing of Resource type properties. It provides options for creating, loading, saving and converting resources. Can be used with EditorInspectorPlugin to recreate the same behavior. Note: This Control does not include any editor for the resource, as editing is controlled by the Inspector dock itself or sub-Inspectors.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

EditorResourcePickerConstructor
# EditorResourcePicker
C#
public EditorResourcePicker();

Properties4

BaseTypeProperty
# BaseType
C#
public string BaseType { get; set; }

The base type of allowed resource types. Can be a comma-separated list of several options.

EditableProperty
# Editable
C#
public bool Editable { get; set; }

If true, the value can be selected and edited.

EditedResourceProperty
# EditedResource
C#
public Resource EditedResource { get; set; }

The edited resource value.

ToggleModeProperty
# ToggleMode
C#
public bool ToggleMode { get; set; }

If true, the main button with the resource preview works in the toggle mode. Use EditorResourcePicker.SetTogglePressed to manually set the state.

Methods12

GetAllowedTypesstring[]
# GetAllowedTypes
C#
public string[] GetAllowedTypes();

Returns a list of all allowed types and subtypes corresponding to the EditorResourcePicker.BaseType. If the EditorResourcePicker.BaseType is empty, an empty list is returned.

Returns string[]
GetBaseTypestring
# GetBaseType
C#
public string GetBaseType();
Returns string
GetEditedResourceResource
# GetEditedResource
C#
public Resource GetEditedResource();
Returns Resource
IsEditablebool
# IsEditable
C#
public bool IsEditable();
Returns bool
IsToggleModebool
# IsToggleMode
C#
public bool IsToggleMode();
Returns bool
SetBaseTypevoid
# SetBaseType
C#
public void SetBaseType(string baseType);
Parameters
NameTypeDefault
baseTypestring—
SetEditablevoid
# SetEditable
C#
public void SetEditable(bool enable);
Parameters
NameTypeDefault
enablebool—
SetEditedResourcevoid
# SetEditedResource
C#
public void SetEditedResource(Resource resource);
Parameters
NameTypeDefault
resourceResource—
SetToggleModevoid
# SetToggleMode
C#
public void SetToggleMode(bool enable);
Parameters
NameTypeDefault
enablebool—
SetTogglePressedvoid
# SetTogglePressed
C#
public void SetTogglePressed(bool pressed);

Sets the toggle mode state for the main button. Works only if EditorResourcePicker.ToggleMode is set to true.

Parameters
NameTypeDefault
pressedbool—
_HandleMenuSelectedbool
# _HandleMenuSelected
C#
public virtual bool _HandleMenuSelected(int id);

This virtual method can be implemented to handle context menu items not handled by default. See EditorResourcePicker._SetCreateOptions.

Parameters
NameTypeDefault
idint—
Returns bool
_SetCreateOptionsvoid
# _SetCreateOptions
C#
public virtual void _SetCreateOptions(ReckfellObject menuNode);

This virtual method is called when updating the context menu of an EditorResourcePicker.Editable EditorResourcePicker. Implement this method to override the "New" items section with your own options. menu_node is a reference to the PopupMenu node. Note: Implement EditorResourcePicker._HandleMenuSelected to handle these custom items. Note: Relevant built-in options ("Load", "Copy", "Paste", etc.) are automatically added to the menu_node afterwards, using their hard-coded IDs starting from 0. Custom options need to use non-colliding IDs to be handled properly. Using id = 100 + custom_option_index is safe (this is what the default items in the "New" section use).

Parameters
NameTypeDefault
menuNodeReckfellObject—

Signals and events2

ResourceChangedEvent
# ResourceChanged
C#
public event EditorResourcePicker.ResourceChangedEventHandler ResourceChanged;

Emitted when the value of the edited resource was changed.

Handler parameters
NameTypeDefault
resourceResource—
ResourceSelectedEvent
# ResourceSelected
C#
public event EditorResourcePicker.ResourceSelectedEventHandler ResourceSelected;

Emitted when the resource value was set and user clicked to edit it. When inspect is true, the signal was caused by the context menu "Edit" or "Inspect" option.

Handler parameters
NameTypeDefault
resourceResource—
inspectbool—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.