AssetRecord
- Namespace: Turian.Engine.Core
- Source File: IAssetFileProvider.cs
Represents a catalog record describing a source asset and its resolved content.
Properties
AssetId
(Guid) { get; set }: Gets or sets the unique asset identifier.
ProjectRootPath
(string) { get; set } = string.Empty: Gets or sets the absolute project root path used to resolve relative content.
AssetTypeName
(string) { get; set } = string.Empty: Gets or sets the asset metadata type name.
ParentAssetId
(Guid) { get; set }: Gets or sets the identifier of the asset this one was imported from, or Empty when the asset has its own source file. Child assets — the materials and textures a model file declares — have no source file and no .meta of their own; they live inside the parent's import directory and are re-emitted whenever the parent is reimported. Records whose parent no longer exists are dropped when the database is rebuilt.
Labels
(List[]: Gets or sets the asset's labels, copied from its metadata so they can be queried without loading it.
SourceRelativePath
(string) { get; set } = string.Empty: Gets or sets the source asset path relative to the project root. Example: Assets/Models/ship.glb.
MetaRelativePath
(string) { get; set } = string.Empty: Gets or sets the source metadata path relative to the project root. Example: Assets/Models/ship.glb.meta.
PrimaryContentKey
(string) { get; set } = string.Empty: Gets or sets the primary logical content key used to resolve the asset payload.
ImportedRelativePath
(string) { get; set } = string.Empty: Gets or sets the imported primary artifact path relative to the project root or runtime root. For assets packed into an Open Asset Package, this points to the .oap file.
StorageKind
(AssetStorageKind) { get; set } = AssetStorageKind.Unknown: Gets or sets the storage kind backing the resolved payload.
SourceHash
(string) { get; set } = string.Empty: Gets or sets the last known source content hash used to produce the imported artifact.
SettingsHash
(string) { get; set } = string.Empty: Gets or sets the hash of the import settings used to produce the imported artifact.
ImporterId
(string) { get; set } = string.Empty: Gets or sets the importer identifier that generated the imported artifact.
ImporterVersion
(int) { get; set }: Gets or sets the importer version used to generate the imported artifact.
Artifacts
(List[]: Gets or sets the list of artifact keys produced for this asset.
TargetArtifacts
(Dictionary<string, string>) { get; set } = []: Gets or sets the artifacts that exist per build target, keyed by TextureBuildTarget. Empty for assets whose single artifact serves every platform, which is everything but textures: GPU texture compression is not portable, so one texture asset owns a set of baked variants and the running platform picks one. ImportedRelativePath already names the variant for the running target; this map is what an export for a different target reads.
ComponentTypes
(List[]: Gets or sets the fully-qualified names of Component types present in the asset content. Only meaningful for prefab-like assets; empty for other asset kinds. Populated at import time so editor pickers and runtime lookups can filter prefabs by component shape without re-parsing their content.
Public Methods
CreatePrimaryContentKey
public static string CreatePrimaryContentKey(Guid assetId)
Creates the default primary content key for the specified asset identifier.
Parameters:
assetId(Guid): The asset identifier.
Returns: string
- A stable logical primary content key.
ResolveContentPath
public string ResolveContentPath()
Resolves the absolute path to the asset payload using the stored project root.
Returns: string
- The absolute path when it can be resolved; otherwise an empty string.