diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs index 764912c..d39c761 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs @@ -30,7 +30,7 @@ namespace YooAsset.Editor PipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(parameters.OutputRoot, parameters.BuildTarget); if (parameters.BuildMode == EBuildMode.DryRunBuild) PipelineOutputDirectory += $"_{EBuildMode.DryRunBuild}"; - else if(parameters.BuildMode == EBuildMode.SimulateBuild) + else if (parameters.BuildMode == EBuildMode.SimulateBuild) PipelineOutputDirectory += $"_{EBuildMode.SimulateBuild}"; } @@ -54,9 +54,7 @@ namespace YooAsset.Editor opt |= BuildAssetBundleOptions.StrictMode; //Do not allow the build to succeed if any errors are reporting during it. if (Parameters.BuildMode == EBuildMode.SimulateBuild) - { throw new Exception("Should never get here !"); - } if (Parameters.BuildMode == EBuildMode.DryRunBuild) { @@ -71,17 +69,13 @@ namespace YooAsset.Editor if (Parameters.BuildMode == EBuildMode.ForceRebuild) opt |= BuildAssetBundleOptions.ForceRebuildAssetBundle; //Force rebuild the asset bundles - if (Parameters.AppendHash) - opt |= BuildAssetBundleOptions.AppendHashToAssetBundleName; //Append the hash to the assetBundle name if (Parameters.DisableWriteTypeTree) opt |= BuildAssetBundleOptions.DisableWriteTypeTree; //Do not include type information within the asset bundle (don't write type tree). if (Parameters.IgnoreTypeTreeChanges) opt |= BuildAssetBundleOptions.IgnoreTypeTreeChanges; //Ignore the type tree changes when doing the incremental build check. - if (Parameters.DisableLoadAssetByFileName) - { - opt |= BuildAssetBundleOptions.DisableLoadAssetByFileName; //Disables Asset Bundle LoadAsset by file name. - opt |= BuildAssetBundleOptions.DisableLoadAssetByFileNameWithExtension; //Disables Asset Bundle LoadAsset by file name with extension. - } + + opt |= BuildAssetBundleOptions.DisableLoadAssetByFileName; //Disables Asset Bundle LoadAsset by file name. + opt |= BuildAssetBundleOptions.DisableLoadAssetByFileNameWithExtension; //Disables Asset Bundle LoadAsset by file name with extension. return opt; } diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs index 632f42c..71466c0 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs @@ -46,12 +46,6 @@ namespace YooAsset.Editor /// public bool EnableAddressable = false; - /// - /// 启用自动分包机制 - /// 说明:自动分包机制可以实现资源零冗余 - /// - public bool EnableAutoCollect = true; - /// /// 追加文件扩展名 /// @@ -68,11 +62,6 @@ namespace YooAsset.Editor /// public ECompressOption CompressOption = ECompressOption.Uncompressed; - /// - /// 文件名附加上哈希值 - /// - public bool AppendHash = false; - /// /// 禁止写入类型树结构(可以降低包体和内存并提高加载效率) /// @@ -83,11 +72,6 @@ namespace YooAsset.Editor /// public bool IgnoreTypeTreeChanges = true; - /// - /// 禁用名称查找资源(可以降内存并提高加载效率) - /// - public bool DisableLoadAssetByFileName = false; - /// /// 获取内置标记列表 diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs index e157041..87827c5 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs @@ -48,11 +48,6 @@ namespace YooAsset.Editor /// public bool EnableAddressable; - /// - /// 启用自动分包机制 - /// - public bool EnableAutoCollect; - /// /// 追加文件扩展名 /// @@ -75,10 +70,8 @@ namespace YooAsset.Editor // 构建参数 public ECompressOption CompressOption; - public bool AppendHash; public bool DisableWriteTypeTree; public bool IgnoreTypeTreeChanges; - public bool DisableLoadAssetByFileName; // 构建结果 public int AssetFileTotalCount; diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs index c0b895f..92ced06 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs @@ -41,7 +41,6 @@ namespace YooAsset.Editor buildReport.Summary.BuildVersion = buildParameters.Parameters.BuildVersion; buildReport.Summary.BuildinTags = buildParameters.Parameters.BuildinTags; buildReport.Summary.EnableAddressable = buildParameters.Parameters.EnableAddressable; - buildReport.Summary.EnableAutoCollect = buildParameters.Parameters.EnableAutoCollect; buildReport.Summary.AppendFileExtension = buildParameters.Parameters.AppendFileExtension; buildReport.Summary.AutoCollectShaders = AssetBundleCollectorSettingData.Setting.AutoCollectShaders; buildReport.Summary.ShadersBundleName = AssetBundleCollectorSettingData.Setting.ShadersBundleName; @@ -50,10 +49,8 @@ namespace YooAsset.Editor // 构建参数 buildReport.Summary.CompressOption = buildParameters.Parameters.CompressOption; - buildReport.Summary.AppendHash = buildParameters.Parameters.AppendHash; buildReport.Summary.DisableWriteTypeTree = buildParameters.Parameters.DisableWriteTypeTree; buildReport.Summary.IgnoreTypeTreeChanges = buildParameters.Parameters.IgnoreTypeTreeChanges; - buildReport.Summary.DisableLoadAssetByFileName = buildParameters.Parameters.DisableLoadAssetByFileName; // 构建结果 buildReport.Summary.AssetFileTotalCount = buildMapContext.AssetFileCount; diff --git a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/SummaryReporterViewer.cs b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/SummaryReporterViewer.cs index 149ceec..6d4bff5 100644 --- a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/SummaryReporterViewer.cs +++ b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/SummaryReporterViewer.cs @@ -71,7 +71,6 @@ namespace YooAsset.Editor _items.Add(new ItemWrapper("内置资源标签", $"{buildReport.Summary.BuildinTags}")); _items.Add(new ItemWrapper("启用可寻址资源定位", $"{buildReport.Summary.EnableAddressable}")); - _items.Add(new ItemWrapper("启用自动分包机制", $"{buildReport.Summary.EnableAutoCollect}")); _items.Add(new ItemWrapper("追加文件扩展名", $"{buildReport.Summary.AppendFileExtension}")); _items.Add(new ItemWrapper("自动收集着色器", $"{buildReport.Summary.AutoCollectShaders}")); _items.Add(new ItemWrapper("着色器资源包名称", $"{buildReport.Summary.ShadersBundleName}")); @@ -80,10 +79,8 @@ namespace YooAsset.Editor _items.Add(new ItemWrapper(string.Empty, string.Empty)); _items.Add(new ItemWrapper("构建参数", string.Empty)); _items.Add(new ItemWrapper("CompressOption", $"{buildReport.Summary.CompressOption}")); - _items.Add(new ItemWrapper("AppendHash", $"{buildReport.Summary.AppendHash}")); _items.Add(new ItemWrapper("DisableWriteTypeTree", $"{buildReport.Summary.DisableWriteTypeTree}")); _items.Add(new ItemWrapper("IgnoreTypeTreeChanges", $"{buildReport.Summary.IgnoreTypeTreeChanges}")); - _items.Add(new ItemWrapper("DisableLoadAssetByFileName", $"{buildReport.Summary.DisableLoadAssetByFileName}")); _items.Add(new ItemWrapper(string.Empty, string.Empty)); _items.Add(new ItemWrapper("构建结果", string.Empty)); diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledAssetProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledAssetProvider.cs index e2efdc0..93bb5ff 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledAssetProvider.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledAssetProvider.cs @@ -69,16 +69,16 @@ namespace YooAsset if (IsWaitForAsyncComplete) { if (MainAssetInfo.AssetType == null) - AssetObject = OwnerBundle.CacheBundle.LoadAsset(MainAssetInfo.AssetName); + AssetObject = OwnerBundle.CacheBundle.LoadAsset(MainAssetInfo.AssetPath); else - AssetObject = OwnerBundle.CacheBundle.LoadAsset(MainAssetInfo.AssetName, MainAssetInfo.AssetType); + AssetObject = OwnerBundle.CacheBundle.LoadAsset(MainAssetInfo.AssetPath, MainAssetInfo.AssetType); } else { if (MainAssetInfo.AssetType == null) - _cacheRequest = OwnerBundle.CacheBundle.LoadAssetAsync(MainAssetInfo.AssetName); + _cacheRequest = OwnerBundle.CacheBundle.LoadAssetAsync(MainAssetInfo.AssetPath); else - _cacheRequest = OwnerBundle.CacheBundle.LoadAssetAsync(MainAssetInfo.AssetName, MainAssetInfo.AssetType); + _cacheRequest = OwnerBundle.CacheBundle.LoadAssetAsync(MainAssetInfo.AssetPath, MainAssetInfo.AssetType); } Status = EStatus.Checking; } @@ -106,9 +106,9 @@ namespace YooAsset if (Status == EStatus.Fail) { if(MainAssetInfo.AssetType == null) - LastError = $"Failed to load asset : {MainAssetInfo.AssetName} AssetType : null AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; + LastError = $"Failed to load asset : {MainAssetInfo.AssetPath} AssetType : null AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; else - LastError = $"Failed to load asset : {MainAssetInfo.AssetName} AssetType : {MainAssetInfo.AssetType} AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; + LastError = $"Failed to load asset : {MainAssetInfo.AssetPath} AssetType : {MainAssetInfo.AssetType} AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; YooLogger.Error(LastError); } InvokeCompletion(); diff --git a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSubAssetsProvider.cs b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSubAssetsProvider.cs index 68be4dc..2349e35 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSubAssetsProvider.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Provider/BundledSubAssetsProvider.cs @@ -69,16 +69,16 @@ namespace YooAsset if (IsWaitForAsyncComplete) { if (MainAssetInfo.AssetType == null) - AllAssetObjects = OwnerBundle.CacheBundle.LoadAssetWithSubAssets(MainAssetInfo.AssetName); + AllAssetObjects = OwnerBundle.CacheBundle.LoadAssetWithSubAssets(MainAssetInfo.AssetPath); else - AllAssetObjects = OwnerBundle.CacheBundle.LoadAssetWithSubAssets(MainAssetInfo.AssetName, MainAssetInfo.AssetType); + AllAssetObjects = OwnerBundle.CacheBundle.LoadAssetWithSubAssets(MainAssetInfo.AssetPath, MainAssetInfo.AssetType); } else { if (MainAssetInfo.AssetType == null) - _cacheRequest = OwnerBundle.CacheBundle.LoadAssetWithSubAssetsAsync(MainAssetInfo.AssetName); + _cacheRequest = OwnerBundle.CacheBundle.LoadAssetWithSubAssetsAsync(MainAssetInfo.AssetPath); else - _cacheRequest = OwnerBundle.CacheBundle.LoadAssetWithSubAssetsAsync(MainAssetInfo.AssetName, MainAssetInfo.AssetType); + _cacheRequest = OwnerBundle.CacheBundle.LoadAssetWithSubAssetsAsync(MainAssetInfo.AssetPath, MainAssetInfo.AssetType); } Status = EStatus.Checking; } @@ -106,9 +106,9 @@ namespace YooAsset if (Status == EStatus.Fail) { if (MainAssetInfo.AssetType == null) - LastError = $"Failed to load sub assets : {MainAssetInfo.AssetName} AssetType : null AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; + LastError = $"Failed to load sub assets : {MainAssetInfo.AssetPath} AssetType : null AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; else - LastError = $"Failed to load sub assets : {MainAssetInfo.AssetName} AssetType : {MainAssetInfo.AssetType} AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; + LastError = $"Failed to load sub assets : {MainAssetInfo.AssetPath} AssetType : {MainAssetInfo.AssetType} AssetBundle : {OwnerBundle.MainBundleInfo.BundleName}"; YooLogger.Error(LastError); } InvokeCompletion(); diff --git a/Assets/YooAsset/Runtime/PatchSystem/AssetInfo.cs b/Assets/YooAsset/Runtime/PatchSystem/AssetInfo.cs index e6188eb..d72f427 100644 --- a/Assets/YooAsset/Runtime/PatchSystem/AssetInfo.cs +++ b/Assets/YooAsset/Runtime/PatchSystem/AssetInfo.cs @@ -41,11 +41,6 @@ namespace YooAsset /// internal string Error { private set; get; } - /// - /// 资源对象名称 - /// - public string AssetName { private set; get; } - /// /// 资源路径 /// @@ -69,7 +64,6 @@ namespace YooAsset _patchAsset = patchAsset; AssetType = assetType; AssetPath = patchAsset.AssetPath; - AssetName = Path.GetFileName(patchAsset.AssetPath); Error = string.Empty; } internal AssetInfo(PatchAsset patchAsset) @@ -80,7 +74,6 @@ namespace YooAsset _patchAsset = patchAsset; AssetType = null; AssetPath = patchAsset.AssetPath; - AssetName = Path.GetFileName(patchAsset.AssetPath); Error = string.Empty; } internal AssetInfo(string error) @@ -88,7 +81,6 @@ namespace YooAsset _patchAsset = null; AssetType = null; AssetPath = string.Empty; - AssetName = string.Empty; Error = error; } }