From ea9b8874cccc8597440377a114811ab1c622fcc9 Mon Sep 17 00:00:00 2001 From: hevinci Date: Wed, 13 Jul 2022 10:48:49 +0800 Subject: [PATCH] Update decryption services MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解密服务接口增加解密文件信息。 --- .../Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs | 6 +++++- Assets/YooAsset/Runtime/Services/IDecryptionServices.cs | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs b/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs index da08447..c212eab 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Loader/AssetBundleFileLoader.cs @@ -117,7 +117,11 @@ namespace YooAsset if (AssetSystem.DecryptionServices == null) throw new Exception($"{nameof(AssetBundleFileLoader)} need {nameof(IDecryptionServices)} : {MainBundleInfo.BundleName}"); - ulong offset = AssetSystem.DecryptionServices.GetFileOffset(); + DecryptionFileInfo fileInfo = new DecryptionFileInfo(); + fileInfo.BundleName = MainBundleInfo.BundleName; + fileInfo.BundleHash = MainBundleInfo.Hash; + fileInfo.BundleCRC = MainBundleInfo.CRC; + ulong offset = AssetSystem.DecryptionServices.GetFileOffset(fileInfo); if (_isWaitForAsyncComplete) CacheBundle = AssetBundle.LoadFromFile(_fileLoadPath, 0, offset); else diff --git a/Assets/YooAsset/Runtime/Services/IDecryptionServices.cs b/Assets/YooAsset/Runtime/Services/IDecryptionServices.cs index 47ff2bd..f037954 100644 --- a/Assets/YooAsset/Runtime/Services/IDecryptionServices.cs +++ b/Assets/YooAsset/Runtime/Services/IDecryptionServices.cs @@ -1,11 +1,18 @@  namespace YooAsset { + public struct DecryptionFileInfo + { + public string BundleName; + public string BundleHash; + public string BundleCRC; + } + public interface IDecryptionServices { /// /// 获取加密文件的数据偏移量 /// - ulong GetFileOffset(); + ulong GetFileOffset(DecryptionFileInfo fileInfo); } } \ No newline at end of file