AssetProps: {
    data?: AssetData;
    exclude?: boolean;
    file?: {
        variants?: {
            basis?: object;
            dxt?: object;
            etc1?: object;
            etc2?: object;
            pvr?: object;
        };
    };
    i18n?: Record<string, string>;
    id?: number;
    meta?: object;
    name?: string;
    path?: number[];
    preload?: boolean;
    source?: boolean;
    source_asset_id?: string;
    tags?: string[];
    type?: string;
    uniqueId?: number;
}

Represents an Asset.

What follows is a reference for all possible asset paths that can be passed to functions such as Asset#get and Asset#set.

Type declaration

  • Optionaldata?: AssetData

    The asset data depend on the type of the asset. Asset data are available at runtime.

  • Optionalexclude?: boolean

    Exclude asset from the project. If true, the asset will not be available at runtime and not be included in published builds.

  • Optionalfile?: {
        variants?: {
            basis?: object;
            dxt?: object;
            etc1?: object;
            etc2?: object;
            pvr?: object;
        };
    }

    Properties related to the file of the asset.

    • Optionalvariants?: { basis?: object; dxt?: object; etc1?: object; etc2?: object; pvr?: object }

      [read-only] Properties for the different variants of the asset file.

      • Optionalbasis?: object

        [read-only] Properties for the BASIS variant of the asset file.

      • Optionaldxt?: object

        [read-only] Properties for the DXT variant of the asset file.

      • Optionaletc1?: object

        [read-only] Properties for the ETC1 variant of the asset file.

      • Optionaletc2?: object

        [read-only] Properties for the ETC2 variant of the asset file.

      • Optionalpvr?: object

        [read-only] Properties for the PVR variant of the asset file.

  • Optionali18n?: Record<string, string>

    A dictionary that holds localized versions of the asset file. Each key in the dictionary is the locale and each value is the asset id.

  • Optionalid?: number

    [read-only] The asset id. This id is the same across different branches.

  • Optionalmeta?: object

    [read-only] Asset properties that depend on the type of the asset. Meta properties are available in the PlayCanvas Editor but not at runtime.

  • Optionalname?: string

    [read-only] The name of the asset.

  • Optionalpath?: number[]

    [read-only] An array of folder asset ids that represent the full path of the asset, if the asset is under one or more folders.

  • Optionalpreload?: boolean

    If true the asset will be loaded during the preload phase of application set up.

  • Optionalsource?: boolean

    [read-only] Whether this is a source asset. A source asset is not included at runtime (e.g. FBX) but may have target assets that are generated from it (e.g. model assets).

  • Optionalsource_asset_id?: string

    [read-only] The id of the source asset that generated this asset.

  • Optionaltags?: string[]

    An array of asset tags.

  • Optionaltype?: string

    [read-only] The type of the asset. Can be: various types listed.

  • OptionaluniqueId?: number

    [read-only] The asset's unique id. This id is different across different branches.