Editor Scripting API

    A handle for the metadata of an asset.

    // Get an asset by either finding an already imported one, or importing it.
    export function findOrCreate(assetManager, absolutePath) {
    let meta = assetManager.findImportedCopy(absolutePath);
    if (meta) {
    return meta.primaryAsset;
    }

    meta = assetManager.importExternalFile(absolutePath);
    return meta.primaryAsset;
    }

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    assets: Editor.Assets.Asset[]

    A list of all the available assets this handle contains.

    id: Uuid

    The unique id of the entity.

    primaryAsset: Editor.Assets.Asset

    The primary asset of this handle. Usually, this is the asset you will assign after accessing an asset.

    sourcePath: Path

    The source file where the asset was imported from.

    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

    • Beta

      Parameters

      • key: string
      • value: string

      Returns void

    MMNEPVFCICPMFPCPTTAAATR