diff --git a/Assets/YooAsset/Runtime/PatchSystem/PatchManifest.cs b/Assets/YooAsset/Runtime/PatchSystem/PatchManifest.cs index 52f561e..1ed8d57 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/PatchManifest.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/PatchManifest.cs @@ -52,19 +52,19 @@ namespace YooAsset /// 资源包集合(提供BundleName获取PatchBundle) /// [NonSerialized] - public readonly Dictionary BundleDic = new Dictionary(); + public Dictionary BundleDic; /// /// 资源映射集合(提供AssetPath获取PatchAsset) /// [NonSerialized] - public readonly Dictionary AssetDic = new Dictionary(); + public Dictionary AssetDic; /// /// 资源路径映射集合 /// [NonSerialized] - public readonly Dictionary AssetPathMapping = new Dictionary(); + public Dictionary AssetPathMapping; // 资源路径映射相关 private bool _isInitAssetPathMapping = false; @@ -85,6 +85,7 @@ namespace YooAsset if (locationToLower) YooLogger.Error("Addressable not support location to lower !"); + AssetPathMapping = new Dictionary(AssetList.Count); foreach (var patchAsset in AssetList) { string location = patchAsset.Address; @@ -97,6 +98,7 @@ namespace YooAsset else { _locationToLower = locationToLower; + AssetPathMapping = new Dictionary(AssetList.Count * 2); foreach (var patchAsset in AssetList) { string location = patchAsset.AssetPath; @@ -385,14 +387,16 @@ namespace YooAsset } } - // BundleList + // BundleDic + manifest.BundleDic = new Dictionary(manifest.BundleList.Count); foreach (var patchBundle in manifest.BundleList) { patchBundle.ParseBundle(manifest.PackageName, manifest.OutputNameStyle); manifest.BundleDic.Add(patchBundle.BundleName, patchBundle); } - // AssetList + // AssetDic + manifest.AssetDic = new Dictionary(manifest.AssetList.Count); foreach (var patchAsset in manifest.AssetList) { // 注意:我们不允许原始路径存在重名