Skip to main content

Editor.IEntityPicker

Class

Popup window that allows the user to choose specific objects in the Scene hierarchy, or assets in the Asset Browser.

Index

Example

// Get access to the project's model component
const model = this.pluginSystem.findInterface(Editor.IModel);
const project = model.project;

// Get access to the picker component
const refPicker = this.pluginSystem.findInterface(Editor.IEntityPicker);

// Open a picker
const type = "SceneObject"

// or Asset, etc.
refPicker.requestPicker(type, (pickedReplacementUid) => {
console.log(pickedReplacementUid);
})

// List assets in project
const assetManager = project.assetManager;
assetManager.assets.forEach( asset => {
console.log(asset.id);
})

// List objects in project's scene
const scene = project.scene;
scene.sceneObjects.forEach( obj => {
console.log(obj.id);
})

Extends

Properties

interfaceId

static interfaceId: InterfaceId

Interface identifier for IEntityPicker.

Methods

getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

IPluginComponent.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

IPluginComponent.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

IPluginComponent.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

IPluginComponent.isSame


requestPicker()

requestPicker(entityType, callback, contextEntities?): void

Open a picker dialog for the user to select an entity of the specified type.

Parameters

ParameterType
entityTypestring
callback(arg1) => void
contextEntities?any

Returns

void