static string GetAssetType(SearchItem item) { if (SearchUtils.GetAssetPath(item) is string assetPath) { return(AssetDatabase.GetMainAssetTypeAtPath(assetPath)?.Name); } return(null); }
static object GetAssetFileSize(SearchItem item) { if (SearchUtils.GetAssetPath(item) is string assetPath && !string.IsNullOrEmpty(assetPath)) { var fi = new FileInfo(assetPath); return(fi.Exists ? fi.Length : 0); } return(null); }