Preparing search index...

    Context object holding the current asset selection, providing access to selected assets and their paths.

        // AssetContext is the IContext subclass handed to right-click callbacks
    // triggered from the asset browser. Its `selection` is an array of
    // AssetContext.Item — each Item exposes `asset` and `path`.
    const registry = this.pluginSystem.findInterface(
    Editor.IContextActionRegistry.interfaceId
    ) as Editor.IContextActionRegistry;

    const guard = registry.registerAction((ctx: Editor.IContext) => {
    if (!ctx.isOfType('Editor.Model.AssetContext')) {
    return undefined as unknown as Editor;
    }
    const assetCtx = ctx as Editor.Model.AssetContext;
    for (const item of assetCtx.selection) {
    console.log(`Selected asset: ${item.asset.name} at ${item.path.toString()}`);
    }
    return undefined as unknown as Editor;
    });
    this.guards.push(guard);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    selection: Item[]

    Read-only array of currently selected asset items in the asset panel.

    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