Editor.Model.AssetImportMetadata
ClassA handle for the metadata of an asset.
Index
Properties
Methods
Example
export async function findOrCreateAsync(assetManager: Editor.Model.AssetManager, absolutePath: Editor.Path): Promise<Editor.Assets.Asset | null> {
const meta = assetManager.findImportedCopy(absolutePath);
if (meta && !Editor.isNull(meta.primaryAsset)) {
return meta.primaryAsset;
}
const result = await assetManager.importExternalFileAsync(absolutePath);
return Editor.isNull(result.primary) ? null : result.primary;
}
Extends
Properties
assets
readonlyassets:Asset[]
A list of all the available assets this handle contains.
assetTreePath
readonlyassetTreePath:SourcePath
Source path of this asset within the asset tree.
compressionSettings
compressionSettings:
AssetCompressionSettings
Compression strategy applied when this asset is imported; assign an AssetCompressionSettings subclass such as SizeCompressionSettings or DracoCompressionSettings.
id
readonlyid:Uuid
The unique id of the entity.
Inherited from
isPackageRoot
readonlyisPackageRoot:boolean
Whether this metadata entry represents the root of a native asset package.
isPackedPackageItem
readonlyisPackedPackageItem:boolean
Indicates whether this item is packed inside a native package.
meta
readonlymeta:Meta
Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.
Inherited from
nativePackageDescriptor
readonlynativePackageDescriptor:NativePackageDescriptor
Descriptor identifying the native package associated with this import metadata.
nativePackageRoot
readonlynativePackageRoot:AssetImportMetadata
Root AssetImportMetadata entry of the native package containing this item.
packagePolicy
readonlypackagePolicy:PackagePolicy
Package policy describing whether and how the native package containing this asset can be unpacked.
primaryAsset
readonlyprimaryAsset:Asset
The primary asset of this handle. Usually, this is the asset you will assign after accessing an asset.
sourcePath
readonlysourcePath:Path
The source file where the asset was imported from.
topmostNativePackageRoot
readonlytopmostNativePackageRoot:AssetImportMetadata
Topmost root AssetImportMetadata in the native package hierarchy.
type
readonlytype:string
The entity's type.
Inherited from
Methods
getDirectlyReferencedEntities()
getDirectlyReferencedEntities():
Entity[]
A list of entities which this entity has a reference to.
Returns
Entity[]
Inherited from
Entity.getDirectlyReferencedEntities
getExtraDataItem()
getExtraDataItem(
key):string
Retrieves a string value from the extra data store by key.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
string
getMeta()
staticgetMeta():Meta
Returns metadata about this type.
Returns
Inherited from
getNativePackageItems()
getNativePackageItems(
iterateOption):AssetImportMetadata[]
Returns child AssetImportMetadata entries within the native package, using the specified iteration depth.
Parameters
| Parameter | Type |
|---|---|
iterateOption | PackageIterate |
Returns
AssetImportMetadata[]
getOwnedEntities()
getOwnedEntities():
Entity[]
A list of entities which has a reference to this entity.
Returns
Entity[]
Inherited from
getTypeName()
staticgetTypeName():string
Returns the type name of this class.
Returns
string
Overrides
getTypeName()
getTypeName():
string
Returns the name of this object's type.
Returns
string
Inherited from
isOfType()
isOfType(
type):boolean
Returns true if the object is of the specified type.
Parameters
| Parameter | Type |
|---|---|
type | string |
Returns
boolean
Inherited from
isSame()
isSame(
other):boolean
Returns true if this object refers to the same instance as the given object.
Parameters
| Parameter | Type |
|---|---|
other | ScriptObject |
Returns
boolean
Inherited from
setExtraDataItem()
setExtraDataItem(
key,value):void
Stores a string value in the extra data store under the given key.
Parameters
| Parameter | Type |
|---|---|
key | string |
value | string |
Returns
void
staticMeta()
staticstaticMeta():Meta
Returns the static metadata descriptor for the AssetImportMetadata type.
Returns
Nested types
Enumerations
| Enumeration | Description |
|---|---|
| PackageIterate | Enum controlling whether native package iteration is shallow or deep. |