Editor Scripting API
    Preparing search index...

    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)

    Index

    Properties

    assets: Editor.Assets.Asset[]

    A list of all the available assets this handle contains.

    id: Uuid

    The unique id of the entity.

    meta: Meta
    nativePackageDescriptor: NativePackageDescriptor
    nativePackageRoot: Editor.Model.AssetImportMetadata
    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.

    topmostNativePackageRoot: Editor.Model.AssetImportMetadata
    type: string

    The entity's type.

    Methods

    • Parameters

      • key: string

      Returns string

    • Parameters

      • type: string

      Returns boolean

    • Parameters

      • key: string
      • value: string

      Returns void