refactor : 重构代码
This commit is contained in:
+5
-5
@@ -28,7 +28,7 @@ namespace YooAsset
|
||||
#if UNITY_WEBGL
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"{nameof(DefaultCacheFileSystem)} is not support WEBGL platform !";
|
||||
Error = $"{nameof(DefaultCacheFileSystem)} is not support WEBGL platform.";
|
||||
#else
|
||||
_steps = ESteps.CheckAppFootPrint;
|
||||
#endif
|
||||
@@ -48,23 +48,23 @@ namespace YooAsset
|
||||
{
|
||||
if (_fileSystem.InstallClearMode == EOverwriteInstallClearMode.None)
|
||||
{
|
||||
YooLogger.Warning("Do nothing when overwrite install application !");
|
||||
YooLogger.Warning("Do nothing when overwrite install application.");
|
||||
}
|
||||
else if (_fileSystem.InstallClearMode == EOverwriteInstallClearMode.ClearAllCacheFiles)
|
||||
{
|
||||
_fileSystem.DeleteAllBundleFiles();
|
||||
_fileSystem.DeleteAllManifestFiles();
|
||||
YooLogger.Warning("Delete all cache files when overwrite install application !");
|
||||
YooLogger.Warning("Delete all cache files when overwrite install application.");
|
||||
}
|
||||
else if (_fileSystem.InstallClearMode == EOverwriteInstallClearMode.ClearAllBundleFiles)
|
||||
{
|
||||
_fileSystem.DeleteAllBundleFiles();
|
||||
YooLogger.Warning("Delete all bundle files when overwrite install application !");
|
||||
YooLogger.Warning("Delete all bundle files when overwrite install application.");
|
||||
}
|
||||
else if (_fileSystem.InstallClearMode == EOverwriteInstallClearMode.ClearAllManifestFiles)
|
||||
{
|
||||
_fileSystem.DeleteAllManifestFiles();
|
||||
YooLogger.Warning("Delete all manifest files when overwrite install application !");
|
||||
YooLogger.Warning("Delete all manifest files when overwrite install application.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+3
-3
@@ -120,7 +120,7 @@ namespace YooAsset
|
||||
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Abort download file !";
|
||||
Error = "Abort download file.";
|
||||
}
|
||||
|
||||
if (_steps == ESteps.LoadAssetBundle)
|
||||
@@ -131,7 +131,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;
|
||||
}
|
||||
@@ -389,7 +389,7 @@ namespace YooAsset
|
||||
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Abort download file !";
|
||||
Error = "Abort download file.";
|
||||
}
|
||||
|
||||
if (_steps == ESteps.LoadCacheRawBundle)
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Can not found active package manifest !";
|
||||
Error = "Can not found active package manifest.";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Clear param is null !";
|
||||
Error = "Clear param is null.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Can not found active package manifest !";
|
||||
Error = "Can not found active package manifest.";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -57,7 +57,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Clear param is null !";
|
||||
Error = "Clear param is null.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Can not found active package manifest !";
|
||||
Error = "Can not found active package manifest.";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Can not found active package manifest !";
|
||||
Error = "Can not found active package manifest.";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+2
-2
@@ -62,7 +62,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Download file options is invalid !";
|
||||
Error = "Download file options is invalid.";
|
||||
Debug.Log(Error);
|
||||
return;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ namespace YooAsset
|
||||
if (IsWaitForAsyncComplete == false && _failedTryAgain > 0)
|
||||
{
|
||||
_steps = ESteps.TryAgain;
|
||||
YooLogger.Warning($"Failed download : {_downloadFileOp.URL} Try again !");
|
||||
YooLogger.Warning($"Failed download : {_downloadFileOp.URL} Try again.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Cache package hash file content is empty !";
|
||||
Error = $"Cache package hash file content is empty.";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = "Failed to verify cache package manifest file!";
|
||||
Error = "Failed to verify cache package manifest file.";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Remote package version file content is empty !";
|
||||
Error = $"Remote package version file content is empty.";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"{_fileSystem.GetType().FullName} failed to write file !";
|
||||
Error = $"{_fileSystem.GetType().FullName} failed to write file.";
|
||||
}
|
||||
|
||||
// 注意:缓存完成后直接删除临时文件
|
||||
|
||||
+2
-2
@@ -133,7 +133,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"{_fileSystem.GetType().FullName} failed to write file !";
|
||||
Error = $"{_fileSystem.GetType().FullName} failed to write file.";
|
||||
}
|
||||
|
||||
// 注意:缓存完成后直接删除临时文件
|
||||
@@ -151,7 +151,7 @@ namespace YooAsset
|
||||
if (_steps != ESteps.Done)
|
||||
{
|
||||
// 注意:不中断下载任务,保持后台继续下载
|
||||
YooLogger.Error($"Try load bundle {_bundle.BundleName} from remote : {URL} !");
|
||||
YooLogger.Error($"Try load bundle {_bundle.BundleName} from remote : {URL}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ namespace YooAsset
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Failed to verify file : {_element.TempFilePath} ! ErrorCode : {VerifyResult}";
|
||||
Error = $"Failed to verify file : {_element.TempFilePath} ErrorCode : {VerifyResult}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user