using System.Collections.Generic; namespace CaoCao.Editor { /// /// 清理重复设置打包分组的资源 /// public class ClearDuplicateAssets : IBuildJobStep { public void Start(BuildJob job) { var pathWithAssets = new Dictionary(); var bundledAssets = job.bundledAssets; for (var i = 0; i < bundledAssets.Count; i++) { var asset = bundledAssets[i]; var path = asset.path; if (!pathWithAssets.TryGetValue(path, out var value)) { pathWithAssets[path] = asset; } else { bundledAssets.RemoveAt(i); i--; CaoCao.XAsset.Logger.W($"Can't pack {path} with {asset.bundle}, because already pack to {value.bundle}"); } } } } }