From e84e50708be7071a01edd6ef006a1dc8c791db42 Mon Sep 17 00:00:00 2001 From: hevinci Date: Thu, 20 Apr 2023 17:56:21 +0800 Subject: [PATCH] update asset bundle builder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加对WEBGL平台加密选项的检测。 --- .../Editor/AssetBundleBuilder/AssetBundleBuilder.cs | 2 +- .../AssetBundleBuilder/BuildSystem/BuildResult.cs | 2 +- .../AssetBundleBuilder/BuildSystem/BuildRunner.cs | 2 +- .../AssetBundleBuilder/BuildTasks/TaskPrepare.cs | 10 ++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs index 88b82e0..9813d7f 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs @@ -94,7 +94,7 @@ namespace YooAsset.Editor { BuildLogger.Warning($"{buildParameters.BuildMode} pipeline build failed !"); BuildLogger.Error($"Build task failed : {buildResult.FailedTask}"); - BuildLogger.Error($"Build task error : {buildResult.FailedInfo}"); + BuildLogger.Error(buildResult.ErrorInfo); } return buildResult; diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildResult.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildResult.cs index c47623d..fe4e251 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildResult.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildResult.cs @@ -19,7 +19,7 @@ namespace YooAsset.Editor /// /// 构建失败的信息 /// - public string FailedInfo; + public string ErrorInfo; /// /// 输出的补丁包目录 diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs index 9cc3e67..bab28d9 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildRunner.cs @@ -52,7 +52,7 @@ namespace YooAsset.Editor { EditorTools.ClearProgressBar(); buildResult.FailedTask = task.GetType().Name; - buildResult.FailedInfo = e.ToString(); + buildResult.ErrorInfo = e.ToString(); buildResult.Success = false; break; } diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs index 5c32428..664ac91 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs @@ -40,6 +40,16 @@ namespace YooAsset.Editor throw new Exception("首包资源标签不能为空!"); } +#if UNITY_WEBGL + if (buildParameters.EncryptionServices != null) + { + if (buildParameters.EncryptionServices.GetType() != typeof(EncryptionNone)) + { + throw new Exception("WebGL平台不支持加密!"); + } + } +#endif + // 检测包裹输出目录是否存在 string packageOutputDirectory = buildParametersContext.GetPackageOutputDirectory(); if (Directory.Exists(packageOutputDirectory))