private void OnGetLoginNoticeInfo(string url, string error, string reply, object userData) { if (string.IsNullOrEmpty(error) == false) { UIManager.Instance.ShowWaitScreen(false); GameDebug.LogError("获取游戏公告失败: " + error); string err = DBConstText.GetText("GET_LOGIN_NOTICE_INFO_FAIL"); #if UNITY_EDITOR err += error; #endif UIWidgetHelp.GetInstance().ShowNoticeDlg(err, (object obj) => { //获取公告信息失败,获取服务器信息 UpdateServerLogic(); }); return; } GameDebug.Log("游戏公告获取成功"); //判断是否需要弹出通告界面 LoginNoticeData data; if (!LoginNoticeUtil.CheckData(reply, out data)) { UIManager.Instance.ShowWaitScreen(false); GameDebug.LogError("获取游戏公告失败: " + reply); string err = DBConstText.GetText("GET_LOGIN_NOTICE_INFO_FAIL"); #if UNITY_EDITOR err += reply; #endif UIWidgetHelp.GetInstance().ShowNoticeDlg(err, (object obj) => { //获取公告信息失败,获取服务器信息 UpdateServerLogic(); }); return; } int lastId = PlayerPrefs.GetInt(LoginNoticeData.LOGIN_ID_KEY, LoginNoticeData.DEFAULT_LOGIN_ID); //判断自动弹出 if (lastId == LoginNoticeData.DEFAULT_LOGIN_ID) { //第一次都弹出 ShowNoticePanel(data, true); } else { //第二次判断是否为强制,或者通告信息发生了改变 if (data.type == 1) { ShowNoticePanel(data, true); } else { //通告没有变化而且不是强制弹出,开始获取服务器信息 //设置当前弹出ID //UpdateServerLogic(); } ////第二次判断是否为强制,或者通告信息发生了改变 //if (data.id != lastId || data.type == 1) //{ // ShowNoticePanel(data, true); //} //else //{ // //通告没有变化而且不是强制弹出,开始获取服务器信息 // //设置当前弹出ID // //UpdateServerLogic(); //} } // 总是获取服务器信息 UpdateServerLogic(); //PlayerPrefs.SetInt(LoginNoticeData.LOGIN_ID_KEY, data.id); UIManager.Instance.ShowWaitScreen(false); }
private void onShowLoginNotice() { LoginNoticeUtil.ShowNormalNotice(); }