Compare commits

...

2 Commits

Author SHA1 Message Date
黑黑面麻的快乐生活
3ddfed4bf1 Merge 1c4aba6db5 into e57466e9e2 2025-06-25 19:06:49 +08:00
hhmmLife
1c4aba6db5 fix: 只有递归收集依赖时,依赖列表中才默认包含主资源 2025-06-23 00:56:50 +08:00

View File

@@ -186,7 +186,15 @@ namespace YooAsset.Editor
throw new Exception($"Fatal : can not found cache info : {assetPath}"); throw new Exception($"Fatal : can not found cache info : {assetPath}");
} }
var result = new HashSet<string> { assetPath }; var result = new HashSet<string>();
// 递归收集依赖时,依赖列表中包含主资源
if (recursive)
{
result.Add(assetPath);
}
// 收集依赖
CollectDependencies(assetPath, assetPath, result, recursive); CollectDependencies(assetPath, assetPath, result, recursive);
// 注意AssetDatabase.GetDependencies保持一致将主资源添加到依赖列表最前面 // 注意AssetDatabase.GetDependencies保持一致将主资源添加到依赖列表最前面