refactor : 重构代码
This commit is contained in:
@@ -206,7 +206,7 @@ namespace YooAsset
|
||||
public static DefaultBuildinFileCatalog DeserializeFromBinary(byte[] binaryData)
|
||||
{
|
||||
if (binaryData == null || binaryData.Length == 0)
|
||||
throw new Exception("Catalog file data is null or empty !");
|
||||
throw new Exception("Catalog file data is null or empty.");
|
||||
|
||||
// 创建缓存器
|
||||
BufferReader buffer = new BufferReader(binaryData);
|
||||
@@ -214,7 +214,7 @@ namespace YooAsset
|
||||
// 读取文件标记
|
||||
uint fileSign = buffer.ReadUInt32();
|
||||
if (fileSign != CatalogFileDefine.FileSign)
|
||||
throw new Exception("Invalid catalog file !");
|
||||
throw new Exception("Invalid catalog file.");
|
||||
|
||||
// 读取文件版本
|
||||
string fileVersion = buffer.ReadUTF8();
|
||||
|
||||
+4
-4
@@ -333,14 +333,14 @@ namespace YooAsset
|
||||
|
||||
#if UNITY_ANDROID
|
||||
//TODO : 安卓平台内置文件属于APK压缩包内的文件。
|
||||
YooLogger.Error($"Android platform not support read buildin bundle file data !");
|
||||
YooLogger.Error($"Android platform not support read buildin bundle file data.");
|
||||
return null;
|
||||
#else
|
||||
if (bundle.Encrypted)
|
||||
{
|
||||
if (DecryptionServices == null)
|
||||
{
|
||||
YooLogger.Error($"The {nameof(IDecryptionServices)} is null !");
|
||||
YooLogger.Error($"The {nameof(IDecryptionServices)} is null.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -370,14 +370,14 @@ namespace YooAsset
|
||||
|
||||
#if UNITY_ANDROID
|
||||
//TODO : 安卓平台内置文件属于APK压缩包内的文件。
|
||||
YooLogger.Error($"Android platform not support read buildin bundle file text !");
|
||||
YooLogger.Error($"Android platform not support read buildin bundle file text.");
|
||||
return null;
|
||||
#else
|
||||
if (bundle.Encrypted)
|
||||
{
|
||||
if (DecryptionServices == null)
|
||||
{
|
||||
YooLogger.Error($"The {nameof(IDecryptionServices)} is null !");
|
||||
YooLogger.Error($"The {nameof(IDecryptionServices)} is null.");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ namespace YooAsset
|
||||
#if UNITY_WEBGL
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"{nameof(DefaultBuildinFileSystem)} is not support WEBGL platform !";
|
||||
Error = $"{nameof(DefaultBuildinFileSystem)} is not support WEBGL platform.";
|
||||
#else
|
||||
if (_fileSystem.CopyBuildinPackageManifest)
|
||||
_steps = ESteps.LoadBuildinPackageVersion;
|
||||
@@ -181,7 +181,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Fatal error : catalog is null !";
|
||||
Error = "Fatal error : catalog is null.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"The {nameof(IBundleDecryptionServices)} is null !";
|
||||
Error = $"The {nameof(IBundleDecryptionServices)} is null.";
|
||||
YooLogger.Error(Error);
|
||||
return;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"The {nameof(IDecryptionServices)} is null !";
|
||||
Error = $"The {nameof(IDecryptionServices)} is null.";
|
||||
YooLogger.Error(Error);
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Failed to verify buildin package manifest file !";
|
||||
Error = "Failed to verify buildin package manifest file.";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Buildin package hash file content is empty !";
|
||||
Error = $"Buildin package hash file content is empty.";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -83,7 +83,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Buildin package version file content is empty !";
|
||||
Error = $"Buildin package version file content is empty.";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user