AssetFile
public class AssetFile : TreeElementIndexed file record with package ownership, project and source paths, media metadata, and preview state.
Methods
Section titled “Methods”
CheckIfInProject()
Section titled “CheckIfInProject()”public void CheckIfInProject()Checks whether the indexed file is already present in the open Unity project and updates its transient import state.
HasPreview(bool)
Section titled “HasPreview(bool)”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
IsUnityPackage()
Section titled “IsUnityPackage()”public bool IsUnityPackage()Reports whether the indexed path represents a Unity package archive.
Returns
System.Boolean
IsArchive()
Section titled “IsArchive()”public bool IsArchive()Reports whether the indexed path has a supported archive format.
Returns
System.Boolean
GetPreviewFolder(string)
Section titled “GetPreviewFolder(string)”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
GetPreviewFile(string, bool)
Section titled “GetPreviewFile(string, bool)”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
GetPath(bool)
Section titled “GetPath(bool)”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
GetSourcePath(bool)
Section titled “GetSourcePath(bool)”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
ToString()
Section titled “ToString()”public override string ToString()Returns
System.String
Constructors
Section titled “Constructors”
AssetFile()
Section titled “AssetFile()”public AssetFile()Properties
Section titled “Properties”
[PrimaryKey][AutoIncrement]public int Id { get; set; }Returns
System.Int32
AssetId
Section titled “AssetId”[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
FileName
Section titled “FileName”[Collation("NOCASE")]public string FileName { get; set; }Returns
System.String
SourcePath
Section titled “SourcePath”public string SourcePath { get; set; }Returns
System.String
FileVersion
Section titled “FileVersion”public string FileVersion { get; set; }Returns
System.String
FileStatus
Section titled “FileStatus”public string FileStatus { get; set; }Returns
System.String
[Indexed]public string Type { get; set; }Returns
System.String
PreviewState
Section titled “PreviewState”[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
Height
Section titled “Height”public int Height { get; set; }Returns
System.Int32
Length
Section titled “Length”public float Length { get; set; }Returns
System.Single
AICaption
Section titled “AICaption”public string AICaption { get; set; }Returns
System.String
Hidden
Section titled “Hidden”[Indexed]public bool Hidden { get; set; }Returns
System.Boolean
FileData
Section titled “FileData”public string FileData { get; set; }Returns
System.String
ProjectPath
Section titled “ProjectPath”[Ignore]public string ProjectPath { get; set; }Returns
System.String
InProject
Section titled “InProject”[Ignore]public bool InProject { get; }Returns
System.Boolean
IsVirtual
Section titled “IsVirtual”[Ignore]public bool IsVirtual { get; }Returns
System.Boolean
ParentGuids
Section titled “ParentGuids”[Ignore]public HashSet<string> ParentGuids { get; set; }Returns
System.Collections.Generic.HashSet{System.String}
ShortPath
Section titled “ShortPath”[Ignore]public string ShortPath { get; }Returns
System.String