mirror of https://github.com/tuyoogame/YooAsset
Fixed special case where the dependent bundle list contained the main bundle
修复了特殊情况下依赖的资源包列表里包含主资源包的问题pull/4/head
parent
89bde69417
commit
eb6b6e3aba
|
@ -116,13 +116,13 @@ namespace YooAsset.Editor
|
||||||
PatchAsset patchAsset = new PatchAsset();
|
PatchAsset patchAsset = new PatchAsset();
|
||||||
patchAsset.AssetPath = assetInfo.AssetPath;
|
patchAsset.AssetPath = assetInfo.AssetPath;
|
||||||
patchAsset.BundleID = GetAssetBundleID(assetInfo.BundleName, patchManifest);
|
patchAsset.BundleID = GetAssetBundleID(assetInfo.BundleName, patchManifest);
|
||||||
patchAsset.DependIDs = GetAssetBundleDependIDs(assetInfo, patchManifest);
|
patchAsset.DependIDs = GetAssetBundleDependIDs(patchAsset.BundleID, assetInfo, patchManifest);
|
||||||
result.Add(patchAsset);
|
result.Add(patchAsset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
private int[] GetAssetBundleDependIDs(BuildAssetInfo assetInfo, PatchManifest patchManifest)
|
private int[] GetAssetBundleDependIDs(int mainBundleID, BuildAssetInfo assetInfo, PatchManifest patchManifest)
|
||||||
{
|
{
|
||||||
List<int> result = new List<int>();
|
List<int> result = new List<int>();
|
||||||
foreach (var dependAssetInfo in assetInfo.AllDependAssetInfos)
|
foreach (var dependAssetInfo in assetInfo.AllDependAssetInfos)
|
||||||
|
@ -130,8 +130,11 @@ namespace YooAsset.Editor
|
||||||
if (dependAssetInfo.BundleNameIsValid() == false)
|
if (dependAssetInfo.BundleNameIsValid() == false)
|
||||||
continue;
|
continue;
|
||||||
int bundleID = GetAssetBundleID(dependAssetInfo.BundleName, patchManifest);
|
int bundleID = GetAssetBundleID(dependAssetInfo.BundleName, patchManifest);
|
||||||
if (result.Contains(bundleID) == false)
|
if (mainBundleID != bundleID)
|
||||||
result.Add(bundleID);
|
{
|
||||||
|
if (result.Contains(bundleID) == false)
|
||||||
|
result.Add(bundleID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return result.ToArray();
|
return result.ToArray();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue