mirror of https://github.com/tuyoogame/YooAsset
update file system
parent
a138701afe
commit
a6ee571d65
|
@ -40,7 +40,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_bundle.Encrypted)
|
if (_bundle.Encrypted)
|
||||||
{
|
{
|
||||||
_downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(_fileSystem.DecryptionServices, _bundle, downloadParam);
|
_downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, downloadParam);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadAssetBundleOp);
|
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadAssetBundleOp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -59,7 +59,7 @@ namespace YooAsset
|
||||||
if (_downloadAssetBundleOp.Status == EOperationStatus.Succeed)
|
if (_downloadAssetBundleOp.Status == EOperationStatus.Succeed)
|
||||||
{
|
{
|
||||||
var assetBundle = _downloadAssetBundleOp.Result;
|
var assetBundle = _downloadAssetBundleOp.Result;
|
||||||
if(assetBundle == null)
|
if (assetBundle == null)
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
Status = EOperationStatus.Failed;
|
Status = EOperationStatus.Failed;
|
||||||
|
|
|
@ -41,7 +41,7 @@ namespace YooAsset
|
||||||
|
|
||||||
if (_bundle.Encrypted)
|
if (_bundle.Encrypted)
|
||||||
{
|
{
|
||||||
_downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(_fileSystem.DecryptionServices, _bundle, downloadParam);
|
_downloadAssetBundleOp = new DownloadWebEncryptAssetBundleOperation(true, _fileSystem.DecryptionServices, _bundle, downloadParam);
|
||||||
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadAssetBundleOp);
|
OperationSystem.StartOperation(_fileSystem.PackageName, _downloadAssetBundleOp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -5,12 +5,14 @@ namespace YooAsset
|
||||||
{
|
{
|
||||||
internal class DownloadWebEncryptAssetBundleOperation : DownloadAssetBundleOperation
|
internal class DownloadWebEncryptAssetBundleOperation : DownloadAssetBundleOperation
|
||||||
{
|
{
|
||||||
|
private readonly bool _checkTimeout;
|
||||||
private readonly IWebDecryptionServices _decryptionServices;
|
private readonly IWebDecryptionServices _decryptionServices;
|
||||||
private DownloadHandlerBuffer _downloadhandler;
|
private DownloadHandlerBuffer _downloadhandler;
|
||||||
private ESteps _steps = ESteps.None;
|
private ESteps _steps = ESteps.None;
|
||||||
|
|
||||||
internal DownloadWebEncryptAssetBundleOperation(IWebDecryptionServices decryptionServices, PackageBundle bundle, DownloadParam param) : base(bundle, param)
|
internal DownloadWebEncryptAssetBundleOperation(bool checkTimeout, IWebDecryptionServices decryptionServices, PackageBundle bundle, DownloadParam param) : base(bundle, param)
|
||||||
{
|
{
|
||||||
|
_checkTimeout = checkTimeout;
|
||||||
_decryptionServices = decryptionServices;
|
_decryptionServices = decryptionServices;
|
||||||
}
|
}
|
||||||
internal override void InternalOnStart()
|
internal override void InternalOnStart()
|
||||||
|
@ -45,7 +47,8 @@ namespace YooAsset
|
||||||
Progress = DownloadProgress;
|
Progress = DownloadProgress;
|
||||||
if (_webRequest.isDone == false)
|
if (_webRequest.isDone == false)
|
||||||
{
|
{
|
||||||
CheckRequestTimeout();
|
if (_checkTimeout)
|
||||||
|
CheckRequestTimeout();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +64,17 @@ namespace YooAsset
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetBundle assetBundle = LoadEncryptedAssetBundle(_downloadhandler.data);
|
var fileData = _downloadhandler.data;
|
||||||
|
if (fileData == null || fileData.Length == 0)
|
||||||
|
{
|
||||||
|
_steps = ESteps.Done;
|
||||||
|
Status = EOperationStatus.Failed;
|
||||||
|
Error = $"The download handler data is null or empty !";
|
||||||
|
YooLogger.Error(Error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
AssetBundle assetBundle = LoadEncryptedAssetBundle(fileData);
|
||||||
if (assetBundle == null)
|
if (assetBundle == null)
|
||||||
{
|
{
|
||||||
_steps = ESteps.Done;
|
_steps = ESteps.Done;
|
||||||
|
|
Loading…
Reference in New Issue