示例#1
0
文件: LoadScene.cs 项目: dydlegd/DT
        IEnumerator CloadScene(bool bNeedUpdate)
        {
            if (bNeedUpdate)
            {
                ClearAll();
            }
            bool bSucceed = true;

            if (!File.Exists(mFile))
            {
                if (!File.Exists(mZipFile))
                {
                    bSucceed = false;
                    var dl = KHttpDownloader.Load(mUrlZipFile, mZipFile, 0);
                    while (!dl.IsFinished)
                    {
                        yield return(null);

                        if (onDownload != null)
                        {
                            onDownload(dl.Progress);
                        }
                    }
                    bSucceed = dl.IsError == false ? true : false;
                    dl.Dispose();
                }
                if (bSucceed)
                {
                    yield return(this.StartCoroutineAsync(CDecompress(mFile)));
                }
            }

            LoadSceneCenter.Instance.OnComplete(this, bSucceed);
        }
示例#2
0
文件: Hall_Update.cs 项目: dydlegd/DT
        IEnumerator StartLoad()
        {
            var dl = KHttpDownloader.Load(mUrlFile, mFile, 0);

            while (!dl.IsFinished)
            {
                yield return(null);

                if (onDownload != null)
                {
                    onDownload(dl.Progress);
                }
            }
            dl.Dispose();

            if (!dl.IsError)
            {
                GameInfoCenter.Instance.GetGameInfo(GameType.大厅).UpdateVerion();
                Application.OpenURL(mFile);
            }
            else
            {
                //下载出错,请重新下载
                StartCoroutine(StartLoad());
            }
        }