Skip to content

AssetFile

ClassAssetInventoryAssetInventory.Editor
public class AssetFile : TreeElement

Indexed file record with package ownership, project and source paths, media metadata, and preview state.

public void CheckIfInProject()

Checks whether the indexed file is already present in the open Unity project and updates its transient import state.

public bool HasPreview(bool allowScheduled = false)

Reports whether a usable cached preview exists, optionally accepting Unity’s built-in preview cache.

Parameters

Name Type
allowScheduled System.Boolean

Returns

System.Boolean

public bool IsUnityPackage()

Reports whether the indexed path represents a Unity package archive.

Returns

System.Boolean

public bool IsArchive()

Reports whether the indexed path has a supported archive format.

Returns

System.Boolean

public string GetPreviewFolder(string previewFolder)

Returns the package-specific directory used to store cached previews for this file.

Parameters

Name Type
previewFolder System.String

Returns

System.String

public string GetPreviewFile(string previewFolder, bool animated = false)

Returns the cached preview path, optionally requiring the file to exist.

Parameters

Name Type
previewFolder System.String
animated System.Boolean

Returns

System.String

public string GetPath(bool expanded)

Returns the materialized or source path for this file according to the requested path policy.

Parameters

Name Type
expanded System.Boolean

Returns

System.String

public string GetSourcePath(bool expanded)

Returns the original indexed source path, optionally resolving package-relative storage.

Parameters

Name Type
expanded System.Boolean

Returns

System.String

public override string ToString()

Returns

System.String

public AssetFile()

[PrimaryKey]
[AutoIncrement]
public int Id { get; set; }

Returns

System.Int32

[Indexed]
public int AssetId { get; set; }

Returns

System.Int32

[Indexed]
public string Guid { get; set; }

Returns

System.String

[Collation("NOCASE")]
public string Path { get; set; }

Returns

System.String

[Collation("NOCASE")]
public string FileName { get; set; }

Returns

System.String

public string SourcePath { get; set; }

Returns

System.String

public string FileVersion { get; set; }

Returns

System.String

public string FileStatus { get; set; }

Returns

System.String

[Indexed]
public string Type { get; set; }

Returns

System.String

[Indexed]
public AssetFile.PreviewOptions PreviewState { get; set; }

Returns

AssetInventory.AssetFile.PreviewOptions

public float Hue { get; set; }

Returns

System.Single

public long Size { get; set; }

Returns

System.Int64

public int Width { get; set; }

Returns

System.Int32

public int Height { get; set; }

Returns

System.Int32

public float Length { get; set; }

Returns

System.Single

public string AICaption { get; set; }

Returns

System.String

[Indexed]
public bool Hidden { get; set; }

Returns

System.Boolean

public string FileData { get; set; }

Returns

System.String

[Ignore]
public string ProjectPath { get; set; }

Returns

System.String

[Ignore]
public bool InProject { get; }

Returns

System.Boolean

[Ignore]
public bool IsVirtual { get; }

Returns

System.Boolean

[Ignore]
public HashSet<string> ParentGuids { get; set; }

Returns

System.Collections.Generic.HashSet{System.String}

[Ignore]
public string ShortPath { get; }

Returns

System.String