/// <summary> /// 更新结束 /// </summary> /// <param name="result">true:成功;false:失败</param> /// <param name="ret">返回码</param> private void FinishCallback(bool result, int ret) { string msg = "整个更新流程结束 " + " result=" + result + " ret = " + ret; DebugLog(msg); //再调一次收尾,最后显示的进度 refreshProgress(); if (result) { setFlowLabel("开始资源预加载..."); setProgress(0, 0, false); EnterGame(); } else { msg = string.Format("资源初始化失败({0})", GetErrorMsg(ret)); if (!LauncherUpdate.IsNetworkEnable()) { msg = "网络已断开,请检查网络后重试!"; } UIMsgBoxForm.Open(msg, "重试", "退出游戏", () => { UpdateManager.Instance.Restart(); }, () => { Application.Quit(); }); } }
void Start() { if (!DevelopSetting.HotFix) { EnterGame(); return; } //判断网络状态 if (LauncherUpdate.IsNetworkEnable()) { if (LauncherUpdate.Is4G()) { UIMsgBoxForm.Open("当前不是WIFI网络,可能会产生流量,确定要继续吗?", "继续", "退出", StartUpdate, ExitGame); } else { StartUpdate(); } } else { UIMsgBoxForm.Open("当前网络不可用,请检查网络", "退出", null, ExitGame); } }