From cfbb67a6a3ddf81abea300409a1ff37fd31df938 Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期四, 30 八月 2018 17:26:18 +0800
Subject: [PATCH] 2199 加载地图过程中可能出现错误的记录
---
System/AssetVersion/DownLoadAndDiscompressTask.cs | 59 +++++++++++++++++++++++++++++------------------------------
1 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/System/AssetVersion/DownLoadAndDiscompressTask.cs b/System/AssetVersion/DownLoadAndDiscompressTask.cs
index ffbb5b6..92ecb87 100644
--- a/System/AssetVersion/DownLoadAndDiscompressTask.cs
+++ b/System/AssetVersion/DownLoadAndDiscompressTask.cs
@@ -1,36 +1,34 @@
-锘縰sing System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-using System;
-using Snxxz.UI;
-using System.Threading;
-
+锘縰sing System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using System;
+using Snxxz.UI;
+using System.Threading;
+
public class DownLoadAndDiscompressTask : Singleton<DownLoadAndDiscompressTask>
{
public const int BYTE_PER_KILOBYTE = 1024;
public const int BYTE_PER_MILLIONBYTE = 1048576;
- public float progress {
- get {
- return Mathf.Clamp01((float)RemoteFile.TotalDownloadedSize / totalSize);
- }
- }
-
- List<AssetVersion> tasks = new List<AssetVersion>();
+ public float progress { get { return Mathf.Clamp01((float)RemoteFile.TotalDownloadedSize / totalSize); } }
+
+ List<AssetVersion> tasks = new List<AssetVersion>();
public bool isDone { get { return step == Step.Completed; } }
public int totalSize { get; private set; }
public int totalCount { get; private set; }
- public int okCount { get; private set; }
- public bool restartApp { get; private set; }
+ public int okCount { get; private set; }
+ public bool restartApp { get; private set; }
public event Action<Step> downLoadStepChangeEvent;
Action downLoadOkCallBack;
Step m_Step = Step.None;
- public Step step {
+ public Step step
+ {
get { return m_Step; }
- set {
+ set
+ {
if (m_Step != value)
{
m_Step = value;
@@ -41,8 +39,8 @@
}
}
}
- }
-
+ }
+
public void Prepare(List<AssetVersion> _downLoadTasks, Action _downLoadOkCallBack)
{
tasks = _downLoadTasks;
@@ -74,14 +72,14 @@
{
StartDownLoad();
}
- }
-
+ }
+
public void StartDownLoad()
{
step = Step.DownLoad;
SnxxzGame.Instance.StartCoroutine(Co_StartDownLoad());
- }
-
+ }
+
IEnumerator Co_StartDownLoad()
{
RemoteFile.maxDownLoadTask = 48;
@@ -121,8 +119,8 @@
{
SDKUtility.Instance.RestartApp();
}
- }
-
+ }
+
private void OnFileDownLoadCompleted(bool _ok, AssetVersion _assetVersion)
{
var correctFile = false;
@@ -138,6 +136,7 @@
}
else
{
+ ExceptionCatcher.ReportException("娓告垙鍚姩闃舵鏂囦欢涓嬭浇澶辫触", "鏂囦欢鍚嶏細" + _assetVersion.relativePath);
var remoteURL = StringUtility.Contact(VersionUtility.Instance.versionInfo.GetResourcesURL(VersionConfig.Get().branch), "/", _assetVersion.relativePath);
var localURL = StringUtility.Contact(ResourcesPath.Instance.ExternalStorePath, _assetVersion.relativePath);
@@ -146,13 +145,13 @@
remoteFile.Begin(OnFileDownLoadCompleted);
}
}
-
+
public enum Step
{
None,
DownLoadPrepared,
DownLoad,
Completed,
- }
-
-}
+ }
+
+}
--
Gitblit v1.8.0