Preparing search index...

    Reusable object template that can be instantiated in scenes.

        const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const assetManager = model.project.assetManager;

    // Find all ObjectPrefab assets in the project
    const prefabs = assetManager.assets.filter(
    a => a.isOfType('ObjectPrefab')
    ) as Editor.Assets.ObjectPrefab[];

    // Inspect each prefab's lazyLoading/retainAssets flags and instances
    let totalInstances = 0;
    for (const prefab of prefabs) {
    totalInstances += prefab.prefabInstances.length;
    }

    console.log(`Total prefabs: ${prefabs.length}, total instances: ${totalInstances}`);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    cacheFile: Path

    Path to the cached asset file.

    Import metadata for the asset.

    id: Uuid

    The unique id of the entity.

    lazyLoading: boolean

    Whether prefab assets load lazily on first use.

    meta: Meta

    Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

    name: string

    The name of the asset.

    prefabInstances: SceneObject[]

    List of scene objects instantiated from this prefab.

    retainAssets: boolean

    Whether referenced assets are preserved when the prefab is modified.

    rootSceneObjects: SceneObject[]

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

    sceneObjects: SceneObject[]

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

    type: string

    The entity's type.

    Methods

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean