style : 统一小游戏编码规范和命名规范
This commit is contained in:
+1
-1
@@ -49,7 +49,7 @@ internal class WXFSDownloadFileOperation : FSDownloadFileOperation
|
||||
_webCacheRequestOp.UpdateOperation();
|
||||
Progress = _webCacheRequestOp.Progress;
|
||||
DownloadProgress = _webCacheRequestOp.DownloadProgress;
|
||||
DownloadedBytes = (long)_webCacheRequestOp.DownloadedBytes;
|
||||
DownloadedBytes = _webCacheRequestOp.DownloadedBytes;
|
||||
if (_webCacheRequestOp.IsDone == false)
|
||||
return;
|
||||
|
||||
|
||||
+4
-4
@@ -6,7 +6,7 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation
|
||||
private enum ESteps
|
||||
{
|
||||
None,
|
||||
DownloadAssetBundle,
|
||||
LoadAssetBundle,
|
||||
Done,
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation
|
||||
}
|
||||
internal override void InternalStart()
|
||||
{
|
||||
_steps = ESteps.DownloadAssetBundle;
|
||||
_steps = ESteps.LoadAssetBundle;
|
||||
}
|
||||
internal override void InternalUpdate()
|
||||
{
|
||||
if (_steps == ESteps.None || _steps == ESteps.Done)
|
||||
return;
|
||||
|
||||
if (_steps == ESteps.DownloadAssetBundle)
|
||||
if (_steps == ESteps.LoadAssetBundle)
|
||||
{
|
||||
if (_loadWebAssetBundleOp == null)
|
||||
{
|
||||
@@ -55,7 +55,7 @@ internal class WXFSLoadBundleOperation : FSLoadBundleOperation
|
||||
_loadWebAssetBundleOp.UpdateOperation();
|
||||
Progress = _loadWebAssetBundleOp.Progress;
|
||||
DownloadProgress = _loadWebAssetBundleOp.DownloadProgress;
|
||||
DownloadedBytes = (long)_loadWebAssetBundleOp.DownloadedBytes;
|
||||
DownloadedBytes = _loadWebAssetBundleOp.DownloadedBytes;
|
||||
if (_loadWebAssetBundleOp.IsDone == false)
|
||||
return;
|
||||
|
||||
|
||||
+13
-13
@@ -16,7 +16,7 @@ namespace YooAsset
|
||||
|
||||
private readonly PackageBundle _bundle;
|
||||
private readonly DownloadFileOptions _options;
|
||||
private UnityWechatAssetBundleRequestOperation _unityWechatAssetBundleRequestOp;
|
||||
private UnityWechatAssetBundleRequestOperation _unityAssetBundleRequestOp;
|
||||
|
||||
private int _requestCount = 0;
|
||||
private float _tryAgainTimer;
|
||||
@@ -42,40 +42,40 @@ namespace YooAsset
|
||||
if (_steps == ESteps.CreateRequest)
|
||||
{
|
||||
string url = GetRequestURL();
|
||||
_unityWechatAssetBundleRequestOp = new UnityWechatAssetBundleRequestOperation(_bundle, url);
|
||||
_unityWechatAssetBundleRequestOp.StartOperation();
|
||||
AddChildOperation(_unityWechatAssetBundleRequestOp);
|
||||
_unityAssetBundleRequestOp = new UnityWechatAssetBundleRequestOperation(_bundle, url);
|
||||
_unityAssetBundleRequestOp.StartOperation();
|
||||
AddChildOperation(_unityAssetBundleRequestOp);
|
||||
_steps = ESteps.CheckRequest;
|
||||
}
|
||||
|
||||
// 检测下载结果
|
||||
if (_steps == ESteps.CheckRequest)
|
||||
{
|
||||
_unityWechatAssetBundleRequestOp.UpdateOperation();
|
||||
Progress = _unityWechatAssetBundleRequestOp.Progress;
|
||||
DownloadProgress = _unityWechatAssetBundleRequestOp.DownloadProgress;
|
||||
DownloadedBytes = (long)_unityWechatAssetBundleRequestOp.DownloadedBytes;
|
||||
if (_unityWechatAssetBundleRequestOp.IsDone == false)
|
||||
_unityAssetBundleRequestOp.UpdateOperation();
|
||||
Progress = _unityAssetBundleRequestOp.Progress;
|
||||
DownloadProgress = _unityAssetBundleRequestOp.DownloadProgress;
|
||||
DownloadedBytes = _unityAssetBundleRequestOp.DownloadedBytes;
|
||||
if (_unityAssetBundleRequestOp.IsDone == false)
|
||||
return;
|
||||
|
||||
if (_unityWechatAssetBundleRequestOp.Status == EOperationStatus.Succeed)
|
||||
if (_unityAssetBundleRequestOp.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Succeed;
|
||||
Result = _unityWechatAssetBundleRequestOp.Result;
|
||||
Result = _unityAssetBundleRequestOp.Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_failedTryAgain > 0)
|
||||
{
|
||||
_steps = ESteps.TryAgain;
|
||||
YooLogger.Warning($"Failed download : {_unityWechatAssetBundleRequestOp.URL} Try again !");
|
||||
YooLogger.Warning($"Failed download : {_unityAssetBundleRequestOp.URL} Try again !");
|
||||
}
|
||||
else
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = _unityWechatAssetBundleRequestOp.Error;
|
||||
Error = _unityAssetBundleRequestOp.Error;
|
||||
YooLogger.Error(Error);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ internal class RequestWechatPackageHashOperation : AsyncOperationBase
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Wechat package hash file content is empty !";
|
||||
Error = $"Web package hash file content is empty !";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ internal class RequestWechatPackageVersionOperation : AsyncOperationBase
|
||||
{
|
||||
_steps = ESteps.Done;
|
||||
Status = EOperationStatus.Failed;
|
||||
Error = $"Wechat package version file content is empty !";
|
||||
Error = $"Web package version file content is empty !";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user