using System.Collections.Generic; using System.Linq; namespace DA_Assets.Extensions { public static class AssetDatabaseExtensions { public static List FindAssetsPathes(this string path, string customType = null) { List assetPathes = new List(); if (customType == null) customType = $"t:{typeof(T).Name}"; #if UNITY_EDITOR string[] guids = UnityEditor.AssetDatabase.FindAssets(customType, new string[] { path.ToRelativePath() }); assetPathes = guids.Select(x => UnityEditor.AssetDatabase.GUIDToAssetPath(x)).ToList(); #endif return assetPathes; } } }