From 80a53006483b40e91208946f2c745b4b0492f7a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=AB=E4=BC=BC=E9=94=A6?= <7997747+suxf@users.noreply.github.com> Date: Thu, 13 Feb 2025 00:12:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BE=AE=E4=BF=A1=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E8=A7=A3=E5=AF=86=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Operation/WXFSLoadBundleOperation.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs index 1169c195..db68f964 100644 --- a/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs +++ b/Assets/YooAsset/Samples~/Extension Sample/Runtime/ExtensionFileSystem/WechatFileSystem/Operation/WXFSLoadBundleOperation.cs @@ -37,7 +37,7 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation if (_webRequest == null) { string mainURL = _fileSystem.RemoteServices.GetRemoteMainURL(_bundle.FileName); - _webRequest = WXAssetBundle.GetAssetBundle(mainURL); + _webRequest = _bundle.Encrypted ? UnityWebRequest.Get(mainURL) : WXAssetBundle.GetAssetBundle(mainURL); _webRequest.SendWebRequest(); } @@ -59,11 +59,17 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation } AssetBundle assetBundle; - var downloadHanlder = _webRequest.downloadHandler as DownloadHandlerWXAssetBundle; + if (_bundle.Encrypted) + { + var downloadHanlder = (DownloadHandlerBuffer)_webRequest.downloadHandler; assetBundle = _fileSystem.LoadEncryptedAssetBundle(_bundle, downloadHanlder.data); + } else + { + var downloadHanlder = (DownloadHandlerWXAssetBundle)_webRequest.downloadHandler; assetBundle = downloadHanlder.assetBundle; + } if (assetBundle == null) {