LensStudio:AssetInstantiator.Descriptor
ClassConfiguration descriptor for the AssetInstantiator plugin, extending BaseDescriptor.
Index
Properties
Methods
Example
// AssetInstantiator.Descriptor extends BaseDescriptor and adds canInstantiate,
// a callback that determines whether this instantiator handles a given asset.
// Lens Studio dispatches drops to the first registered instantiator whose
// descriptor.canInstantiate returns true for the asset.
const d = new Descriptor();
d.id = 'com.docs.AssetInstantiatorDescriptorExample';
d.name = 'Texture Drop Instantiator';
d.description = 'Drops a Texture into the scene as a textured plane';
d.dependencies = [Editor.Model.IModel];
d.canInstantiate = (asset: Editor.Assets.Asset) => asset.isOfType('Texture');
Extends
Constructors
Constructor
new Descriptor():
Descriptor
Constructs a new Descriptor instance for configuring the AssetInstantiator plugin.
Returns
Descriptor
Overrides
BaseDescriptor.constructor
Properties
canInstantiate
canInstantiate: (
arg1) =>any
Function that takes an asset and returns whether it can be instantiated by this descriptor.
Parameters
| Parameter | Type |
|---|---|
arg1 | Asset |
Returns
any
dependencies
dependencies:
InterfaceId[]
Array of interface IDs that this plugin requires to function.
Inherited from
description
description:
string
Human-readable description of the plugin shown in the plugin manager.
Inherited from
id
id:
string
Unique identifier for the plugin, typically in reverse domain notation.
Inherited from
intendedPlatforms
intendedPlatforms:
TargetPlatform[]
Array of target platforms (Snapchat, Spectacles) where this plugin is intended to run.
Inherited from
BaseDescriptor.intendedPlatforms
interfaces
interfaces:
InterfaceId[]
Array of interface IDs that this plugin provides or implements.
Inherited from
name
name:
string
Display name of the plugin.
Inherited from
Methods
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean