From c98f43c160102eccac2e907cb2ecab53bc2a8665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C3=98lsted?= Date: Tue, 21 May 2024 14:03:34 +0200 Subject: [PATCH] Update AssetDatabase.FindAssets usages return type To ensure AssetDatabase.FindAssets works no matter what the return type is, the variables have been changed to type var instead of string. --- source/VersionHandler/src/VersionHandler.cs | 2 +- source/VersionHandlerImpl/src/VersionHandlerImpl.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/VersionHandler/src/VersionHandler.cs b/source/VersionHandler/src/VersionHandler.cs index 1cb03ada..0b0f719e 100644 --- a/source/VersionHandler/src/VersionHandler.cs +++ b/source/VersionHandler/src/VersionHandler.cs @@ -153,7 +153,7 @@ private static void BootStrap() { if (implAvailable) return; var assemblies = new List(); - foreach (string assetGuid in AssetDatabase.FindAssets("l:gvh")) { + foreach (var assetGuid in AssetDatabase.FindAssets("l:gvh")) { string filename = AssetDatabase.GUIDToAssetPath(assetGuid); var match = VERSION_HANDLER_FILENAME_RE.Match(filename); if (match.Success) assemblies.Add(match); diff --git a/source/VersionHandlerImpl/src/VersionHandlerImpl.cs b/source/VersionHandlerImpl/src/VersionHandlerImpl.cs index 36e32fe2..99729e8d 100644 --- a/source/VersionHandlerImpl/src/VersionHandlerImpl.cs +++ b/source/VersionHandlerImpl/src/VersionHandlerImpl.cs @@ -2722,7 +2722,7 @@ public static string[] SearchAssetDatabase(string assetsFilter = null, } var assetGuids = searchDirectories == null ? AssetDatabase.FindAssets(assetsFilter) : AssetDatabase.FindAssets(assetsFilter, searchDirectories); - foreach (string assetGuid in assetGuids) { + foreach (var assetGuid in assetGuids) { string filename = AssetDatabase.GUIDToAssetPath(assetGuid); // Ignore non-existent files as it's possible for the asset database to reference // missing files if it hasn't been refreshed or completed a refresh.