Skip to content

Commit 093d2c7

Browse files
committed
✨ Feature 新增原始资源查询可寻址路径
1 parent 9f6fc2a commit 093d2c7

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Editor/Windows/Data/AssetCollectRoot.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ public static void FindAssetLocal()
393393
var guid = AssetDatabase.AssetPathToGUID(path);
394394
if (string.IsNullOrEmpty(guid)) return;
395395
var root = GetOrCreate();
396-
var list = new List<string>();
396+
var list = new List<(string, string, string)>();
397397
foreach (var package in root.Packages)
398398
{
399399
if (package is null) continue;
@@ -408,18 +408,20 @@ public static void FindAssetLocal()
408408
// 是否是否被过滤
409409
var address = item.GetAddress(path);
410410
if (string.IsNullOrEmpty(address)) continue;
411-
list.Add(address);
411+
list.Add((package.Name, group.Name, address));
412412
}
413413
}
414414
}
415415

416-
if (list.Count == 0)
417-
{
418-
Debug.Log($"未找到资源{path}的可寻址路径");
419-
}
416+
if (list.Count == 0) Debug.Log($"未找到资源{path}的可寻址路径");
420417
else
421418
{
422-
Debug.Log($"资源:{path}\n可寻址路径为:\n{string.Join("\n", list)}");
419+
var str = string.Join("\n", list.Select(tuple => @$"
420+
Package : {tuple.Item1}
421+
Group : {tuple.Item2}
422+
Address : {tuple.Item3}
423+
"));
424+
Debug.Log($"资源{path}的可寻址路径:\n{str}");
423425
}
424426
}
425427
}

0 commit comments

Comments
 (0)