mirror of https://github.com/tuyoogame/YooAsset
update extension sample
parent
a9a9368b9b
commit
9e806861ec
|
@ -62,7 +62,7 @@ internal class TTFSLoadBundleOperation : FSLoadBundleOperation
|
|||
AssetBundle assetBundle;
|
||||
var downloadHanlder = _webRequest.downloadHandler as DownloadHandlerTTAssetBundle;
|
||||
if (_bundle.Encrypted)
|
||||
assetBundle = _fileSystem.LoadEncryptedAssetBundle(downloadHanlder.data);
|
||||
assetBundle = _fileSystem.LoadEncryptedAssetBundle(_bundle, downloadHanlder.data);
|
||||
else
|
||||
assetBundle = downloadHanlder.assetBundle;
|
||||
|
||||
|
|
|
@ -272,9 +272,14 @@ internal class TiktokFileSystem : IFileSystem
|
|||
/// <summary>
|
||||
/// 加载加密资源文件
|
||||
/// </summary>
|
||||
public AssetBundle LoadEncryptedAssetBundle(byte[] fileData)
|
||||
public AssetBundle LoadEncryptedAssetBundle(PackageBundle bundle, byte[] fileData)
|
||||
{
|
||||
return DecryptionServices.LoadAssetBundle(fileData);
|
||||
WebDecryptFileInfo fileInfo = new WebDecryptFileInfo();
|
||||
fileInfo.BundleName = bundle.BundleName;
|
||||
fileInfo.FileLoadCRC = bundle.UnityCRC;
|
||||
fileInfo.FileData = fileData;
|
||||
var decryptResult = DecryptionServices.LoadAssetBundle(fileInfo);
|
||||
return decryptResult.Result;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation
|
|||
AssetBundle assetBundle;
|
||||
var downloadHanlder = _webRequest.downloadHandler as DownloadHandlerWXAssetBundle;
|
||||
if (_bundle.Encrypted)
|
||||
assetBundle = _fileSystem.LoadEncryptedAssetBundle(downloadHanlder.data);
|
||||
assetBundle = _fileSystem.LoadEncryptedAssetBundle(_bundle, downloadHanlder.data);
|
||||
else
|
||||
assetBundle = downloadHanlder.assetBundle;
|
||||
|
||||
|
|
|
@ -290,9 +290,14 @@ internal class WechatFileSystem : IFileSystem
|
|||
/// <summary>
|
||||
/// 加载加密资源文件
|
||||
/// </summary>
|
||||
public AssetBundle LoadEncryptedAssetBundle(byte[] fileData)
|
||||
public AssetBundle LoadEncryptedAssetBundle(PackageBundle bundle, byte[] fileData)
|
||||
{
|
||||
return DecryptionServices.LoadAssetBundle(fileData);
|
||||
WebDecryptFileInfo fileInfo = new WebDecryptFileInfo();
|
||||
fileInfo.BundleName = bundle.BundleName;
|
||||
fileInfo.FileLoadCRC = bundle.UnityCRC;
|
||||
fileInfo.FileData = fileData;
|
||||
var decryptResult = DecryptionServices.LoadAssetBundle(fileInfo);
|
||||
return decryptResult.Result;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue