Exemplo n.º 1
0
        void DownloadNewClient()
        {
            string url      = _patchUrl + "_" + ILRuntimeHelper.GetDownladName() + ".apk";
            string savepath = Application.persistentDataPath + "/" + _targetVersion + "_game.apk";

            Downloader.DownloadFiles(new List <DownloadFile>()
            {
                new DownloadFile(url, savepath)
            },
                                     (obj) =>
            {
                if (!File.Exists(savepath))
                {
                    ChangeCurrentUpdateState(UpdateState.OpenNewClientUrl);
                }
                else
                {
                    ChangeCurrentUpdateState(UpdateState.InstallNewClient);
                }
            },
                                     (arg) =>
            {
                object[] args = arg as object[];
                _currentProgress.Progreess = (float)args[0];
                _onShowUpdateProgress(_currentProgress);
            });
        }