void Init() { System.Action <bool> updateFinish = delegate(bool result) { UIWindowUpdate.Close(); UIWindowFirstLoading.Show(); Debug.Log("GameCenter.Init:检查更新结束"); InitResManager(); }; if (SystemConfig.Instance.IsAutoUpdate) { UIWindowUpdate.Show(); // UIManager.Instance.OpenWindow("PanelUpdate"); //VersionManager.Instance.UpdateGame(updateFinish); UIWindowFirstLoading.Hide(); Debug.Log("GameCenter.Init:开始检查更新"); VersionManager.Instance.UpdateGame(updateFinish); } else { UIWindowUpdate.Close(); UIWindowFirstLoading.Show(); InitResManager(); } Debug.Log("GameCenter.Init"); }
static int Hide(IntPtr L) { try { ToLua.CheckArgsCount(L, 0); UIWindowFirstLoading.Hide(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
IEnumerator DownLoadResItemImp(ResInfo item, int totalCount, int current, System.Action <bool, string, ResInfo> updateFinish) { //WWW www = new WWW(item.resURL); WWW www = HTTPTool.GetWWW(item.resURL); //ui提示 UIWindowUpdate.Instance.ShowDownloadTips(totalCount, current + 1, item.resName, www, item.resSize); UIWindowFirstLoading.Hide(); yield return(www); if (string.IsNullOrEmpty(www.error) == false) { //下载出错 Debug.LogError(www.error + item.resURL); // updateFinish(false, "资源下载失败,请点击重试", item); updateFinish(false, LanguageConfig.GetText(5), item); yield break; } else { UIWindowUpdate.Instance.ShowVerifyTips(); UIWindowFirstLoading.Hide(); if (MD5Tool.Verify(www.bytes, item.resMD5)) { //解压文件--下载成功 UIWindowUpdate.Instance.ShowUnZipTips(); UIWindowFirstLoading.Hide(); ZIPTool.DecompressToDirectory(www.bytes, MyFileUtil.CacheDir); updateFinish(true, "", item); } else { //md5 匹配不上 string str = string.Format("VersionManager.DownLoadResImp:资源{0} md5出错", item.resURL); Debug.LogError(str); // updateFinish(false, "资源校验失败,md5值不匹配,请点击重新下载", item); updateFinish(false, LanguageConfig.GetText(6), item); yield break; } } }