From 46c9110b850faedccac006c474c2dab6966cdca7 Mon Sep 17 00:00:00 2001 From: hevinci Date: Fri, 3 Mar 2023 11:51:48 +0800 Subject: [PATCH] update asset bundle builder --- .../AssetBundleBuilder/AssetBundleBuilderWindow.cs | 2 +- .../AssetBundleBuilder/BuildTasks/TaskEncryption.cs | 7 +++---- .../Editor/AssetBundleBuilder/DefaultEncryption.cs | 11 +++++++++++ .../AssetBundleBuilder/DefaultEncryption.cs.meta | 11 +++++++++++ 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 Assets/YooAsset/Editor/AssetBundleBuilder/DefaultEncryption.cs create mode 100644 Assets/YooAsset/Editor/AssetBundleBuilder/DefaultEncryption.cs.meta diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs index e78e821..d688887 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs @@ -60,7 +60,7 @@ namespace YooAsset.Editor // 加密服务类 _encryptionServicesClassTypes = GetEncryptionServicesClassTypes(); - _encryptionServicesClassNames = _encryptionServicesClassTypes.Select(t => t.FullName).ToList(); + _encryptionServicesClassNames = _encryptionServicesClassTypes.Select(t => t.Name).ToList(); // 输出目录 string defaultOutputRoot = AssetBundleBuilderHelper.GetDefaultOutputRoot(); diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskEncryption.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskEncryption.cs index 8172467..a393635 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskEncryption.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskEncryption.cs @@ -27,17 +27,16 @@ namespace YooAsset.Editor private void EncryptingBundleFiles(BuildParametersContext buildParametersContext, BuildMapContext buildMapContext) { var encryptionServices = buildParametersContext.Parameters.EncryptionServices; - - // 如果没有设置加密类 if (encryptionServices == null) return; + if (encryptionServices.GetType() == typeof(EncryptionNone)) + return; + int progressValue = 0; string pipelineOutputDirectory = buildParametersContext.GetPipelineOutputDirectory(); foreach (var bundleInfo in buildMapContext.BundleInfos) { - bundleInfo.LoadMethod = EBundleLoadMethod.Normal; - EncryptFileInfo fileInfo = new EncryptFileInfo(); fileInfo.BundleName = bundleInfo.BundleName; fileInfo.FilePath = $"{pipelineOutputDirectory}/{bundleInfo.BundleName}"; diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/DefaultEncryption.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/DefaultEncryption.cs new file mode 100644 index 0000000..44f5053 --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/DefaultEncryption.cs @@ -0,0 +1,11 @@ + +namespace YooAsset.Editor +{ + public class EncryptionNone : IEncryptionServices + { + public EncryptResult Encrypt(EncryptFileInfo fileInfo) + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/DefaultEncryption.cs.meta b/Assets/YooAsset/Editor/AssetBundleBuilder/DefaultEncryption.cs.meta new file mode 100644 index 0000000..3c666d3 --- /dev/null +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/DefaultEncryption.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 46b8b200b841799498896403d9d427c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: