|
|
@@ -165,14 +165,15 @@ public class LaunchLoadMgr
|
|
|
|
|
|
private IEnumerator CheckResUpdate()
|
|
|
{
|
|
|
+ DownloadMgr Dmgr = DownloadMgr.Instance;
|
|
|
m_LoadingRootGo.SetActive(true);
|
|
|
- DownloadMgr.Instance.CheckVersion();
|
|
|
+ Dmgr.CheckVersion();
|
|
|
SetLoadDes("CheckRes");
|
|
|
SetLoadPrecent(0);
|
|
|
int pre = 0;
|
|
|
yield return new WaitUntil(() =>
|
|
|
{
|
|
|
- if (!DownloadMgr.Instance.CheckFinish)
|
|
|
+ if (!Dmgr.CheckFinish)
|
|
|
{
|
|
|
pre += 10;
|
|
|
if (pre >= 100)
|
|
|
@@ -185,22 +186,22 @@ public class LaunchLoadMgr
|
|
|
pre = 100;
|
|
|
}
|
|
|
SetLoadPrecent(pre);
|
|
|
- return DownloadMgr.Instance.CheckFinish;
|
|
|
+ return Dmgr.CheckFinish;
|
|
|
});
|
|
|
|
|
|
|
|
|
- if (DownloadMgr.Instance.CheckNeedDownload())
|
|
|
+ if (Dmgr.CheckNeedDownload())
|
|
|
{
|
|
|
SetLoadDes("DownloadRes");
|
|
|
SetLoadPrecent(0);
|
|
|
yield return new WaitUntil(() =>
|
|
|
{
|
|
|
- bool isFinish = DownloadMgr.Instance.DownLoadFinish();
|
|
|
+ bool isFinish = Dmgr.DownLoadFinish();
|
|
|
if (isFinish)
|
|
|
{
|
|
|
|
|
|
//#if UNITY_IOS
|
|
|
- if (DownloadMgr.Instance.DowmloadError)
|
|
|
+ if (Dmgr.DowmloadError)
|
|
|
{
|
|
|
isFinish = false;
|
|
|
SetLoadDes("GameLogin20");
|
|
|
@@ -213,16 +214,28 @@ public class LaunchLoadMgr
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- float dsize = DownloadMgr.Instance.DownloadSize;
|
|
|
- float tsize = DownloadMgr.Instance.TotalSize;
|
|
|
+ float dsize = Dmgr.DownloadSize;
|
|
|
+ float tsize = Dmgr.TotalSize;
|
|
|
float press = (dsize / tsize) * 100;
|
|
|
SetLoadPrecent((int)press);
|
|
|
+ if (Dmgr.DownloadTaskMaxNum == 1)
|
|
|
+ {
|
|
|
+ string tstr = (tsize / (1024 * 1024)).ToString("f2");
|
|
|
+ string dstr = (dsize / (1024 * 1024)).ToString("f2");
|
|
|
+
|
|
|
+ string str = I18N.T("DownloadResSize");
|
|
|
+ if (str == "DownloadResSize")
|
|
|
+ {
|
|
|
+ str = "资源下载:{0}m/{1}m";
|
|
|
+ }
|
|
|
+ SetLoadDes(string.Format(str, dstr, tstr));
|
|
|
+ }
|
|
|
}
|
|
|
return isFinish;
|
|
|
});
|
|
|
}
|
|
|
yield return new WaitForSeconds(1);
|
|
|
- DownloadMgr.Instance.Free();
|
|
|
+ Dmgr.Free();
|
|
|
OnEndDownload();
|
|
|
}
|
|
|
|