Editor.Model.Entity
ClassAn object in the scene, or asset in the Editor.Model.AssetManager
Index
Properties
Methods
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const assets = model.project.assetManager.assets;
if (assets.length === 0) {
console.log('No assets in project.');
return;
}
const entity: Editor.Model.Entity = assets[0] as unknown as Editor.Model.Entity;
console.log(`Entity id: ${entity.id}`);
console.log(`Entity type: ${entity.type}`);
const referenced = entity.getDirectlyReferencedEntities();
console.log(`Directly referenced entities: ${referenced.length}`);
const owned = entity.getOwnedEntities();
console.log(`Owned entities: ${owned.length}`);
Extends
Extended by
AssetPassInfoVertexBindingGsafImporterSettingsAssetImportMetadataEntityStructureLayersPrefabable
Properties
id
readonlyid:Uuid
The unique id of the entity.
meta
readonlymeta:Meta
Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.
type
readonlytype:string
The entity's type.
Methods
getDirectlyReferencedEntities()
getDirectlyReferencedEntities():
Entity[]
A list of entities which this entity has a reference to.
Returns
Entity[]
getMeta()
staticgetMeta():Meta
Returns metadata about this type.
Returns
getOwnedEntities()
getOwnedEntities():
Entity[]
A list of entities which has a reference to this entity.
Returns
Entity[]
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