Preparing search index...

    Metadata descriptor for a native package asset.

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

    const selectedAssets = selection.assets;
    if (selectedAssets.length === 0) return;

    const asset = selectedAssets[0];

    // Walk the package chain: asset -> fileMeta -> topmostNativePackageRoot -> nativePackageDescriptor
    const meta = asset.fileMeta;
    if (Editor.isNull(meta)) return;

    const rootMeta = meta.topmostNativePackageRoot;
    if (Editor.isNull(rootMeta)) return;

    const descriptor = rootMeta.nativePackageDescriptor;
    if (Editor.isNull(descriptor)) return;

    // Only instantiate if the package has a non-empty setupScript
    if (Editor.isNull(descriptor.setupScript) || descriptor.setupScript.code.length === 0) return;

    console.log(`Instantiating package "${descriptor.packageName}" for asset: ${asset.name}`);
    const result = await assetManager.instantiate([asset]);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    attachments: Editor.Assets.Asset[]

    Array of asset files included in the package.

    cacheFile: Path

    Path to the cached asset file.

    componentId: Uuid

    Unique identifier for the package component.

    description: string

    Human-readable description of the package.

    exportId: Uuid

    Unique identifier for the package export.

    Import metadata for the asset.

    icon: Editor.Icon

    Visual icon representing the package.

    id: Uuid

    The unique id of the entity.

    meta: Meta

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

    name: string

    The name of the asset.

    packageName: string

    Name of the package.

    Documentation text for the package.

    setupScript: SetupScript

    Script executed during package setup.

    tags: string[]

    Keywords or categories for package discovery.

    type: string

    The entity's type.

    Version number of the package.

    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

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean