Update AssetSystem

pull/4/head
hevinci 2022-03-24 21:34:18 +08:00
parent 44ac4ebb8f
commit e8a7be6957
2 changed files with 14 additions and 6 deletions

View File

@ -86,7 +86,7 @@ namespace YooAsset
return asset as TObject; return asset as TObject;
} }
YooLogger.Warning($"Not found sub asset {assetName} in {_provider.AssetPath}"); YooLogger.Warning($"Not found sub asset object : {assetName}");
return null; return null;
} }
} }

View File

@ -95,12 +95,20 @@ namespace YooAsset
// 4. 检测文件 // 4. 检测文件
if (_steps == ESteps.CheckFile) if (_steps == ESteps.CheckFile)
{ {
// 注意:本地已经存在的文件不保证完整性 // 注意:如果原生文件已经存在,则验证其完整性
if (File.Exists(_savePath)) if (File.Exists(_savePath))
{ {
_steps = ESteps.Done; bool result = DownloadSystem.CheckContentIntegrity(_savePath, _bundleInfo.SizeBytes, _bundleInfo.CRC);
Status = EOperationStatus.Succeed; if (result)
return; {
_steps = ESteps.Done;
Status = EOperationStatus.Succeed;
return;
}
else
{
File.Delete(_savePath);
}
} }
if (_bundleInfo.IsBuildinJarFile()) if (_bundleInfo.IsBuildinJarFile())
@ -166,7 +174,7 @@ namespace YooAsset
return null; return null;
return File.ReadAllBytes(_savePath); return File.ReadAllBytes(_savePath);
} }
/// <summary> /// <summary>
/// 获取原生文件的文本数据 /// 获取原生文件的文本数据
/// </summary> /// </summary>