/// <summary> /// Returns paths to all assets that match this filter using AssetDatabase. /// </summary> public static string[] FindAssets(string filter) { string[] paths = Relay.FindAssets(filter); for (int i = 0; i < paths.Length; i++) { ref string path = ref paths[i]; path = path.Replace("Assets/", ""); }
/// <summary> /// Loads all assets of this kind using AssetDatabase. /// </summary> public static List <T> FindAssetsByType <T>() where T : Object { List <T> assets = new List <T>(); string[] paths = Relay.FindAssets <T>(); for (int i = 0; i < paths.Length; i++) { string path = paths[i]; T asset = Relay.LoadAssetAtPath <T>(path); if (asset != null) { assets.Add(asset); } } return(assets); }