public void getPrize(MessageHandle msg) { // 检测是否有足够的空间容纳奖励 if (isStorageFull(prize) || !StorageManagerment.Instance.isTempStorageFull(count)) { //和后台通讯拿奖励 SignInFport fport = FPortManager.Instance.getFPort("SignInFport") as SignInFport; //补签 type= 2,正常签到 type = 1 if (dayOfMonth != ServerTimeKit.getDayOfMonth()) //补签 { fport.signIn(sid, 2, showAwardInfo); return; } fport.signIn(sid, 1, showAwardInfo); } else //飘字提示临时仓库空间不足 { UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => { win.Initialize(LanguageConfigManager.Instance.getLanguage("signInTips2")); }); } }
/// <summary> /// 签到状态表现更新 /// </summary> public void updateSignState() { switch (signState) { case NoticeActivitySignInContent.SIGN_IN_NO: //没签过 signedInFlag.gameObject.SetActive(false); if (ServerTimeKit.getDayOfMonth() > dayOfMonth) //当天之前 { needSignFlag.gameObject.SetActive(true); } else if (ServerTimeKit.getDayOfMonth() == dayOfMonth) //正是当天 { needSignFlag.gameObject.SetActive(false); linkQualityEffectPointByRotate(); showEffectByQuality(); //显示环绕特效 } break; case NoticeActivitySignInContent.SIGN_IN_YES: //签过 signedInFlag.gameObject.SetActive(true); needSignFlag.gameObject.SetActive(false); break; } }
public void updateTime() { if (noticeSample == null) { return; } if (tip == null) { return; } int type = noticeSample.type; int now = ServerTimeKit.getSecondTime(); int current = ServerTimeKit.getCurrentSecond(); if (type == NoticeType.HAPPY_TURN_SPRITE) { if (UserManager.Instance.self.getUserLevel() >= noticeSample.levelLimit && NoticeManagerment.Instance.turnSpriteData.num != 0) { tip.SetActive(true); tipLabel.text = NoticeManagerment.Instance.turnSpriteData.num.ToString(); } else if (tip.activeSelf) { tip.SetActive(false); } } else if (type == NoticeType.XIANSHI_HAPPY_TURN) { if (UserManager.Instance.self.getUserLevel() >= noticeSample.levelLimit && NoticeManagerment.Instance.xs_turnSpriteData.num != 0) { tip.SetActive(true); tipLabel.text = NoticeManagerment.Instance.xs_turnSpriteData.num.ToString(); } else if (tip.activeSelf) { tip.SetActive(false); } } else if (type == NoticeType.ALCHEMY) { if (!(NoticeManagerment.Instance.getAlchemyConsume() > 0)) { if (!tip.activeSelf) { tip.gameObject.SetActive(true); } } else if (tip.activeSelf) { tip.gameObject.SetActive(false); } } else if (type == NoticeType.HEROEAT) { int[] info = NoticeManagerment.Instance.getHeroEatInfo(); if (info != null && info [1] < now && now < info [2] && info [3] == 0) { if (!tip.activeSelf) { tip.gameObject.SetActive(true); } } else if (tip.activeSelf) { tip.gameObject.SetActive(false); } } else if (type == NoticeType.TOPUPNOTICE || type == NoticeType.COSTNOTICE || type == NoticeType.TIME_RECHARGE || type == NoticeType.NEW_RECHARGE || type == NoticeType.NEW_CONSUME) { List <Recharge> temps = RechargeManagerment.Instance.getValidRechargesByTime((noticeSample.content as SidNoticeContent).sids, now); if (temps == null || temps.Count == 0) { tip.gameObject.SetActive(false); } else { tip.gameObject.SetActive(true); tipLabel.text = temps.Count.ToString(); } } else if (type == NoticeType.NEW_EXCHANGE) { //List<Exchange> temps = ExchangeManagerment.Instance.getValidExchangesByTime ((noticeSample.content as NewExchangeNoticeContent).actives[0].exchangeSids, noticeSample.type, now); // if (temps == null || temps.Count == 0) { // tip.gameObject.SetActive (false); // }else{ // tip.gameObject.SetActive (true); // tipLabel.text = temps.Count.ToString (); // } int count = 0; for (int i = 0; i < (noticeSample.content as NewExchangeNoticeContent).actives.Length; i++) { count += (ExchangeManagerment.Instance.getValidExchangesByTime((noticeSample.content as NewExchangeNoticeContent).actives[i].exchangeSids, NoticeType.EXCHANGENOTICE, now)).Count; } if (count == 0) { tip.gameObject.SetActive(false); } else { tip.gameObject.SetActive(false); // tip.gameObject.SetActive (true); // tipLabel.text = count.ToString(); } } else if (type == NoticeType.EXCHANGENOTICE) { List <Exchange> temps = ExchangeManagerment.Instance.getValidExchangesByTime((noticeSample.content as SidNoticeContent).sids, noticeSample.type, now); if (temps == null || temps.Count == 0) { tip.gameObject.SetActive(false); } else if (noticeSample.sid != 4) { tip.gameObject.SetActive(true); tipLabel.text = temps.Count.ToString(); } else if (noticeSample.sid == 4) //vip兑换特殊处理 { if (PlayerPrefs.GetString(PlayerPrefsComm.VIP_EXCHANGE_TIP) == "ok") { tip.gameObject.SetActive(true); } else { tip.gameObject.SetActive(false); } } } else if (type == NoticeType.ONERMB) { int state = RechargeManagerment.Instance.getOneRmbState(); if (state != RechargeManagerment.ONERMB_STATE_VALID) { tip.gameObject.SetActive(false); } else { tip.gameObject.SetActive(true); } } else if (type == NoticeType.MONTHCARD) { int state = NoticeManagerment.Instance.getMonthCardRewardState(); if (state != NoticeManagerment.MONTHCARD_STATE_VALID) { tip.gameObject.SetActive(false); } else { tip.gameObject.SetActive(true); } } else if (type == NoticeType.HAPPY_SUNDAY) { int num = HappySundayManagerment.Instance.getCanReceiveNum(); tip.gameObject.SetActive(num > 0); if (tip.gameObject.activeSelf) { tipLabel.text = num.ToString(); } } else if (type == NoticeType.QUIZ_EXAM) { bool isEnbale = (notice as QuizNotice).isCanAnswer(); if (isEnbale) { tip.gameObject.SetActive(true); } else { tip.gameObject.SetActive(false); } } else if (type == NoticeType.QUIZ_SURVEY) { bool isEnbale = (notice as QuizNotice).isCanAnswer(); if (isEnbale) { tip.gameObject.SetActive(true); } else { tip.gameObject.SetActive(false); } } else if (type == NoticeType.DAILY_REBATE) { int num = 0; ArrayList dailyList = TaskManagerment.Instance.getDailyRebateTask(); for (int i = 0; i < dailyList.Count; i++) { if (TaskManagerment.Instance.isComplete(dailyList[i] as Task)) { num++; } } if (num > 0) { tip.gameObject.SetActive(true); tipLabel.text = num.ToString(); } else { tip.gameObject.SetActive(false); tipLabel.text = ""; } } else if (type == NoticeType.LIMIT_COLLECT) { int num = 0; foreach (int sid in (noticeSample.content as SidNoticeContent).sids) { LimitCollectSample sample = NoticeActiveManagerment.Instance.getActiveInfoBySid(sid) as LimitCollectSample; if (sample != null && sample.isCanReceive()) { num++; } } if (num > 0) { tip.gameObject.SetActive(true); tipLabel.text = num.ToString(); } else { tip.gameObject.SetActive(false); tipLabel.text = ""; } } else if (type == NoticeType.ONE_MANY_RECHARGE) { List <Recharge> temps = RechargeManagerment.Instance.getValidRechargesByTime((noticeSample.content as SidNoticeContent).sids, now); if (temps == null || temps.Count == 0) { tip.gameObject.SetActive(false); } else { tip.gameObject.SetActive(true); tipLabel.text = temps.Count.ToString(); } } else if (type == NoticeType.SUPERDRAW) { if (SuperDrawManagerment.Instance == null) { tip.gameObject.SetActive(false); return; } else { int count = SuperDrawManagerment.Instance.superDraw.canUseNum; if (count == 0) { tip.gameObject.SetActive(false); } else { tip.gameObject.SetActive(true); tipLabel.text = count.ToString(); } } } else if (type == NoticeType.SIGNIN) { SignInSample sample = SignInSampleManager.Instance.getSignInSampleBySid(StringKit.toInt(notice.sid + "" + ServerTimeKit.getCurrentMonth())); if (sample == null) { return; } List <int> sids = sample.daySids; if (!SignInManagerment.Instance.stateList.Contains(sids[ServerTimeKit.getDayOfMonth() - 1])) { tip.gameObject.SetActive(true); tipLabel.text = "1"; } else { tip.gameObject.SetActive(false); } } else if (type == NoticeType.SHAREDRAW) { if (ShareDrawManagerment.Instance.isFirstShare == 0 && ShareDrawManagerment.Instance.canDrawTimes == 0) { tip.gameObject.SetActive(true); tipLabel.text = "1"; } else if (ShareDrawManagerment.Instance.canDrawTimes != 0 && ShareDrawManagerment.Instance.isFirstShare == 0) { tip.gameObject.SetActive(true); tipLabel.text = (ShareDrawManagerment.Instance.canDrawTimes + 1).ToString(); } else if (ShareDrawManagerment.Instance.canDrawTimes != 0 && ShareDrawManagerment.Instance.isFirstShare != 0) { tip.gameObject.SetActive(true); tipLabel.text = ShareDrawManagerment.Instance.canDrawTimes.ToString(); } else { tip.gameObject.SetActive(false); } } else if (type == NoticeType.WEEKCARD) { if (WeekCardInfo.Instance.recevieState == WeekCardRecevieState.recevie) { tip.gameObject.SetActive(true); tipLabel.text = "1"; } else { tip.gameObject.SetActive(false); } } else if (type == NoticeType.BACK_PRIZE) { if (BackPrizeLoginInfo.Instance.loginDays <= BackPrizeInfoFPort.tottalLoginDays) { if (BackPrizeLoginInfo.Instance.loginDays - BackPrizeLoginInfo.Instance.receivedDays.Count > 0) { tip.gameObject.SetActive(true); tipLabel.text = (BackPrizeLoginInfo.Instance.loginDays - BackPrizeLoginInfo.Instance.receivedDays.Count).ToString(); } else { tip.gameObject.SetActive(false); } } else { if (BackPrizeInfoFPort.tottalLoginDays - BackPrizeLoginInfo.Instance.receivedDays.Count > 0) { tip.gameObject.SetActive(true); tipLabel.text = (BackPrizeInfoFPort.tottalLoginDays - BackPrizeLoginInfo.Instance.receivedDays.Count).ToString(); } else { tip.gameObject.SetActive(false); } } } else if (type == NoticeType.BACK_RECHARGE) { if (BackPrizeRechargeInfo.Instance.getCanRecevieCount() - BackPrizeRechargeInfo.Instance.getReceviedCount() > 0) { tip.gameObject.SetActive(true); tipLabel.text = (BackPrizeRechargeInfo.Instance.getCanRecevieCount() - BackPrizeRechargeInfo.Instance.getReceviedCount()).ToString(); } else { tip.gameObject.SetActive(false); } } else if (type == NoticeType.XIANSHI_FANLI) { if (RebateInfoManagement.Instance.canRecevieCount > 0) { tip.gameObject.SetActive(true); tipLabel.text = RebateInfoManagement.Instance.canRecevieCount.ToString(); } else { tip.gameObject.SetActive(false); } } else if (type == NoticeType.LOTTERY) { if (LotteryManagement.Instance.getLotteryCount() + LotteryManagement.Instance.selectedAwardCount > 0) { if ((notice as LotteryNotice).isActivityOpen()) { tip.gameObject.SetActive(true); tipLabel.text = (LotteryManagement.Instance.getLotteryCount() + LotteryManagement.Instance.selectedAwardCount).ToString(); } else { if (LotteryManagement.Instance.selectedAwardCount > 0) { tip.gameObject.SetActive(true); tipLabel.text = LotteryManagement.Instance.selectedAwardCount.ToString(); } else { tip.gameObject.SetActive(false); } } } else { tip.gameObject.SetActive(false); } } }
public void DefaultClickEvent() { if (ServerTimeKit.getDayOfMonth() < dayOfMonth) //还没到签到时间,可点击查看奖励信息 { if (equip != null) { UiManager.Instance.openWindow <EquipAttrWindow>( (winEquip) => { winEquip.Initialize(equip, EquipAttrWindow.OTHER, null); }); } else if (starSoul != null) { UiManager.Instance.openDialogWindow <StarSoulAttrWindow>( (win) => { win.Initialize(starSoul, StarSoulAttrWindow.AttrWindowType.None); }); } else if (prop != null) { UiManager.Instance.openDialogWindow <PropAttrWindow>( (winProp) => { winProp.Initialize(prop); }); } else if (card != null) { CardBookWindow.Show(card, CardBookWindow.SHOW, null); } else if (magicWeapon != null) { UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => { win.init(magicWeapon, MagicWeaponType.FORM_OTHER); }); } else if (prize != null) { if ((prize.type == PrizeType.PRIZE_MONEY || prize.type == PrizeType.PRIZE_RMB)) { MaskWindow.UnlockUI(); } else { UiManager.Instance.openDialogWindow <PropAttrWindow>((winProp) => { winProp.Initialize(prize); }); } } else { MaskWindow.UnlockUI(); } } else if (ServerTimeKit.getDayOfMonth() > dayOfMonth) //过了当前签到日期的 { if (signState == NoticeActivitySignInContent.SIGN_IN_NO) //没签过的 //打开补签窗口 { UiManager.Instance.openDialogWindow <SignInWindow>((win) => { win.Initialize(prize, (msg) => { getPrize(msg); }); }); } else if (signState == NoticeActivitySignInContent.SIGN_IN_YES) //签过的 { MaskWindow.UnlockUI(); } } else if (ServerTimeKit.getDayOfMonth() == dayOfMonth) { if (signState == NoticeActivitySignInContent.SIGN_IN_YES) { MaskWindow.UnlockUI(); } else { getPrize(null); } } }