Skip to content

AssetUtils

ClassAssetInventoryAssetInventory.Editor
public static class AssetUtils

No description is available for this type.

public static bool IsPrefab(string mainFile)

No description is available for this member.

Parameters

Name Type Description
mainFile System.String

Returns

System.Boolean — No return description is available.

public static bool CanAddToScene(string mainFile)

No description is available for this member.

Parameters

Name Type Description
mainFile System.String

Returns

System.Boolean — No return description is available.

public static void AddToScene(string projectPath)

No description is available for this member.

Parameters

Name Type Description
projectPath System.String
public static void AddToScene(string projectPath, Vector3 worldPosition, Transform parentTransform = null)

No description is available for this member.

Parameters

Name Type Description
projectPath System.String
worldPosition UnityEngine.Vector3
parentTransform UnityEngine.Transform
public static string GetProjectRoot()

No description is available for this member.

Returns

System.String — No return description is available.

public static bool IsAssetDatabasePath(string path, bool allowPackages = true)

No description is available for this member.

Parameters

Name Type Description
path System.String
allowPackages System.Boolean

Returns

System.Boolean — No return description is available.

public static string GetAssetDatabasePath(string path, bool allowPackages = true)

No description is available for this member.

Parameters

Name Type Description
path System.String
allowPackages System.Boolean

Returns

System.String — No return description is available.

public static string AddProjectRoot(string path)

No description is available for this member.

Parameters

Name Type Description
path System.String

Returns

System.String — No return description is available.

public static string RemoveProjectRoot(string path)

No description is available for this member.

Parameters

Name Type Description
path System.String

Returns

System.String — No return description is available.

public static void RemoveLODGroups(string path)

No description is available for this member.

Parameters

Name Type Description
path System.String
public static int GetPageCount(int resultCount, int maxResults)

No description is available for this member.

Parameters

Name Type Description
resultCount System.Int32
maxResults System.Int32

Returns

System.Int32 — No return description is available.

public static void ClearCache()

No description is available for this member.

public static int RemoveMissingScripts(this Transform obj)

No description is available for this member.

Parameters

Name Type Description
obj UnityEngine.Transform

Returns

System.Int32 — No return description is available.

public static Task<AudioClip> LoadAudioFromFile(string filePath, bool allowStreaming = true)

Loads an audio file from disk. Uses streaming by default for better performance.

Parameters

Name Type Description
filePath System.String Path to the audio file
allowStreaming System.Boolean If true, uses streaming for better performance. Set to false if you need to access raw sample data with GetData().

Returns

System.Threading.Tasks.Task{UnityEngine.AudioClip} — No return description is available.

LoadTextures(List, CancellationToken, Action<int, Texture2D>)

Section titled “LoadTextures(List, CancellationToken, Action<int, Texture2D>)”
public static void LoadTextures(List<AssetInfo> infos, CancellationToken ct, Action<int, Texture2D> callback = null)

No description is available for this member.

Parameters

Name Type Description
infos System.Collections.Generic.List{AssetInventory.AssetInfo}
ct System.Threading.CancellationToken
callback System.Action{System.Int32,UnityEngine.Texture2D}
public static Task LoadPackageTexture(AssetInfo info, bool useCache = true)

No description is available for this member.

Parameters

Name Type Description
info AssetInventory.AssetInfo
useCache System.Boolean

Returns

System.Threading.Tasks.Task — No return description is available.

public static void RemoveFromPreviewCache(string file)

No description is available for this member.

Parameters

Name Type Description
file System.String
public static Task<Texture2D> LoadLocalTexture(string file, bool useCache, int upscale = 0, bool upscaleIsMax = false)

No description is available for this member.

Parameters

Name Type Description
file System.String
useCache System.Boolean
upscale System.Int32
upscaleIsMax System.Boolean

Returns

System.Threading.Tasks.Task{UnityEngine.Texture2D} — No return description is available.

FetchAPIData(string, string, string, string, string, Action, int, Action, bool, string)

Section titled “FetchAPIData(string, string, string, string, string, Action, int, Action, bool, string)”
public static Task<T> FetchAPIData<T>(string uri, string method = "GET", string postContent = null, string token = null, string etag = null, Action<string> eTagCallback = null, int retries = 1, Action<long> responseIssueCodeCallback = null, bool suppressErrors = false, string postType = "application/json")

No description is available for this member.

Parameters

Name Type Description
uri System.String
method System.String
postContent System.String
token System.String
etag System.String
eTagCallback System.Action{System.String}
retries System.Int32
responseIssueCodeCallback System.Action{System.Int64}
suppressErrors System.Boolean
postType System.String

Returns

System.Threading.Tasks.Task{{T}} — No return description is available.

public static Task LoadImageAsync(string imageUrl, string targetFile)

No description is available for this member.

Parameters

Name Type Description
imageUrl System.String
targetFile System.String

Returns

System.Threading.Tasks.Task — No return description is available.

public static bool IsMp3File(string filePath)

No description is available for this member.

Parameters

Name Type Description
filePath System.String

Returns

System.Boolean — No return description is available.

public static string GuessSafeName(string name, string replacement = "")

No description is available for this member.

Parameters

Name Type Description
name System.String
replacement System.String

Returns

System.String — No return description is available.

public static Dictionary<string, List<AssetInfo>> Guids2Files(List<string> guids, bool returnOriginIfNotFound = false, List<int> excludeIds = null, HashSet<string> guidsWithOrigin = null)

No description is available for this member.

Parameters

Name Type Description
guids System.Collections.Generic.List{System.String}
returnOriginIfNotFound System.Boolean
excludeIds System.Collections.Generic.List{System.Int32}
guidsWithOrigin System.Collections.Generic.HashSet{System.String}

Returns

System.Collections.Generic.Dictionary{System.String,System.Collections.Generic.List{AssetInventory.AssetInfo}} — No return description is available.

public static string ExtractGuidFromFile(string path)

No description is available for this member.

Parameters

Name Type Description
path System.String

Returns

System.String — No return description is available.

public static bool UpdateGuidInMetaFile(string metaPath, string newGuid)

No description is available for this member.

Parameters

Name Type Description
metaPath System.String
newGuid System.String

Returns

System.Boolean — No return description is available.

public static bool IsOnURP()

No description is available for this member.

Returns

System.Boolean — No return description is available.

public static bool IsOnHDRP()

No description is available for this member.

Returns

System.Boolean — No return description is available.

IsPackageCompatibleWithCurrentSRP(AssetInfo)

Section titled “IsPackageCompatibleWithCurrentSRP(AssetInfo)”
public static bool IsPackageCompatibleWithCurrentSRP(AssetInfo asset)

Checks if a package is compatible with the current project’s render pipeline. Package-level flags: URPCompatible, HDRPCompatible, BIRPCompatible.

Parameters

Name Type Description
asset AssetInventory.AssetInfo Asset/package to check

Returns

System.Boolean — True if package is compatible with current render pipeline

public static void FilterIncompatibleSRPPackages(List<AssetInfo> files)

Filters out files from render pipeline support packages that are incompatible with the current project’s render pipeline. For BIRP projects, removes all URP and HDRP support packages. For URP projects, removes HDRP-only support packages. For HDRP projects, removes URP-only support packages.

Parameters

Name Type Description
files System.Collections.Generic.List{AssetInventory.AssetInfo} List of AssetInfo files to filter
public static string GetURPVersion()

No description is available for this member.

Returns

System.String — No return description is available.

public static string GetHDRPVersion()

No description is available for this member.

Returns

System.String — No return description is available.

public static bool IsUnityProject(string folder)

No description is available for this member.

Parameters

Name Type Description
folder System.String

Returns

System.Boolean — No return description is available.

public static bool ShouldBeBIRPCompatible(string assetName)

No description is available for this member.

Parameters

Name Type Description
assetName System.String

Returns

System.Boolean — No return description is available.

public static bool ShouldBeURPCompatible(string assetName)

No description is available for this member.

Parameters

Name Type Description
assetName System.String

Returns

System.Boolean — No return description is available.

public static bool ShouldBeHDRPCompatible(string assetName)

No description is available for this member.

Parameters

Name Type Description
assetName System.String

Returns

System.Boolean — No return description is available.

public static List<Rect> CreateUVs(int columns, int rows)

No description is available for this member.

Parameters

Name Type Description
columns System.Int32
rows System.Int32

Returns

System.Collections.Generic.List{UnityEngine.Rect} — No return description is available.

public static Texture2D ExtractFrame(Texture2D sourceTexture, Rect uvRect)

No description is available for this member.

Parameters

Name Type Description
sourceTexture UnityEngine.Texture2D
uvRect UnityEngine.Rect

Returns

UnityEngine.Texture2D — No return description is available.

public static bool ConvertBinaryToYaml(string binaryPath, string targetPath)

Converts a binary serialized Unity file to YAML text format.

Parameters

Name Type Description
binaryPath System.String Path to the binary serialized file
targetPath System.String Target path for the YAML text file

Returns

System.Boolean — True if conversion succeeded, false otherwise