A native asset that provides information for visual objects rendering. Learn more at "Lens Scripting".Built-In.ObjectPrefab. Import with Editor.Model.AssetManager.createNativeAsset.

interface ObjectPrefab {
    fileMeta: AssetImportMetadata;
    id: Uuid;
    lazyLoading: boolean;
    name: string;
    prefabInstances: Editor.Model.SceneObject[];
    retainAssets: boolean;
    rootSceneObjects: Editor.Model.SceneObject[];
    sceneObjects: Editor.Model.SceneObject[];
    type: string;
    addSceneObject(parent: Editor.Model.SceneObject): Editor.Model.SceneObject;
    createSceneObject(name: string): Editor.Model.SceneObject;
    findComponents(entityType: string): Editor.Components.Component[];
    getDirectlyReferencedEntities(): Entity[];
    getOwnedEntities(): Entity[];
    getRootObjectIndex(object: Editor.Model.SceneObject): number;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
    remapReferences(referenceMapping: object): void;
    reparentSceneObject(object: Editor.Model.SceneObject, newParent: Editor.Model.SceneObject, position?: number): void;
}

Hierarchy (view full)

Properties

id: Uuid

The unique id of the entity.

lazyLoading: boolean
name: string

The name of the asset.

prefabInstances: Editor.Model.SceneObject[]
retainAssets: boolean
rootSceneObjects: Editor.Model.SceneObject[]

A list of scene objects which is a direct child of this entity.

sceneObjects: Editor.Model.SceneObject[]

A list of scene objects which is a child of this entity.

type: string

The entity's type.

Methods

  • Beta

    Parameters

    • type: string

    Returns boolean

  • Beta

    Swap this entity for another one based on a JSON of the current entity id and the target entity id.

    Parameters

    • referenceMapping: object

    Returns void