Skip to main content

LensStudio:AssetUtils.js.findOrCreateNativeAsset

Function

Finds or creates a native asset with the specified name.

findOrCreateNativeAsset(nativeAssetTypeName, assetManager, basename, destinationDir?): Asset

Finds or creates a native asset with the specified name.

Parameters

ParameterTypeDescription
nativeAssetTypeNamestringThe name of the native asset.
assetManagerAssetManagerThe asset manager.
basenamestringThe base name of the asset.
destinationDir?Paththe relative path to Assets root in the project, if searching will be limited to this directory, and the asset will be created in this directory if not found. If not provided, the search will be done in the entire project and the creation will be in the root directory.

Returns

Asset

The found or created native asset.