Skip to main content

Editor.Model.EntityPrototypeData

Class

Defines prototype data for an entity type, including its display metadata and factory function.

Index

Example

// EntityPrototypeData describes a new entity type your plugin contributes
// to the "Add Component" / "Add Asset" menu. You build one, then register
// it with IEntityPrototypeRegistry — the returned IGuard controls its
// lifetime (dispose to remove).
const registry = this.pluginSystem.findInterface(
Editor.Model.IEntityPrototypeRegistry
) as Editor.Model.IEntityPrototypeRegistry;

const proto = new Editor.Model.EntityPrototypeData();
proto.baseEntityType = 'Component';
proto.entityType = 'com.docs.MyCustomEffect';
proto.caption = 'My Custom Effect';
proto.section = 'Effects';

const guard = registry.registerEntityPrototype(proto);
this.guards.push(guard);

// Verify registration
const caption = registry.getCaptionForType(proto.entityType);
console.log(`Registered "${proto.entityType}" in section "${proto.section}": ${caption}`);

Constructors

Constructor

new EntityPrototypeData(): EntityPrototypeData

Constructs a new EntityPrototypeData instance representing a prototype definition for a scene entity.

Returns

EntityPrototypeData

Properties

baseEntityType

baseEntityType: string

The base entity type string this prototype derives from.


caption

caption: string

Display name shown for the entity type in the UI.


creator

creator: any

Factory function or callable used to instantiate the entity.


entityType

entityType: string

Unique string identifier for this entity type.


icon

icon: Icon

Icon associated with this entity type in the editor.


section

section: string

Section or category grouping this entity type belongs to.