update decryption services

pull/82/head
hevinci 2023-03-08 12:22:09 +08:00
parent 7b41fd82a4
commit ed77d6dc1f
2 changed files with 9 additions and 9 deletions

View File

@ -26,7 +26,7 @@ namespace YooAsset
private DownloaderBase _unpacker; private DownloaderBase _unpacker;
private DownloaderBase _downloader; private DownloaderBase _downloader;
private AssetBundleCreateRequest _createRequest; private AssetBundleCreateRequest _createRequest;
private FileStream _fileStream; private Stream _stream;
public AssetBundleFileLoader(AssetSystemImpl impl, BundleInfo bundleInfo) : base(impl, bundleInfo) public AssetBundleFileLoader(AssetSystemImpl impl, BundleInfo bundleInfo) : base(impl, bundleInfo)
@ -196,12 +196,12 @@ namespace YooAsset
} }
else if (loadMethod == EBundleLoadMethod.LoadFromStream) else if (loadMethod == EBundleLoadMethod.LoadFromStream)
{ {
_fileStream = Impl.DecryptionServices.LoadFromStream(fileInfo); _stream = Impl.DecryptionServices.LoadFromStream(fileInfo);
uint managedReadBufferSize = Impl.DecryptionServices.GetManagedReadBufferSize(); uint managedReadBufferSize = Impl.DecryptionServices.GetManagedReadBufferSize();
if (_isWaitForAsyncComplete) if (_isWaitForAsyncComplete)
CacheBundle = AssetBundle.LoadFromStream(_fileStream, 0, managedReadBufferSize); CacheBundle = AssetBundle.LoadFromStream(_stream, 0, managedReadBufferSize);
else else
_createRequest = AssetBundle.LoadFromStreamAsync(_fileStream, 0, managedReadBufferSize); _createRequest = AssetBundle.LoadFromStreamAsync(_stream, 0, managedReadBufferSize);
} }
else else
{ {
@ -265,11 +265,11 @@ namespace YooAsset
{ {
base.Destroy(forceDestroy); base.Destroy(forceDestroy);
if (_fileStream != null) if (_stream != null)
{ {
_fileStream.Close(); _stream.Close();
_fileStream.Dispose(); _stream.Dispose();
_fileStream = null; _stream = null;
} }
} }

View File

@ -32,7 +32,7 @@ namespace YooAsset
/// <summary> /// <summary>
/// 文件流解密方法 /// 文件流解密方法
/// </summary> /// </summary>
System.IO.FileStream LoadFromStream(DecryptFileInfo fileInfo); System.IO.Stream LoadFromStream(DecryptFileInfo fileInfo);
/// <summary> /// <summary>
/// 文件流解密的托管缓存大小 /// 文件流解密的托管缓存大小