private void clickBuyButton(GameObject obj) { ActiveTime activeTime = (fatherContent.notice as ConsumeRebateNotice).activeTime; int now = ServerTimeKit.getSecondTime(); if (now < activeTime.getDetailStartTime()) { UiManager.Instance.createMessageLintWindow(Language("s0171")); } else if (now > activeTime.getDetailEndTime()) { UiManager.Instance.createMessageLintWindow(Language("ConsumeRebate_07")); } else if (activeGoods.getRoleCountCanBuy() < 1) { UiManager.Instance.createMessageLintWindow(Language("ConsumeRebate_08")); } else if (activeGoods.getServerCountCanBuy() < 1) { UiManager.Instance.createMessageLintWindow(Language("ConsumeRebate_09")); } else if (activeGoods.getSample().rmbCondition > fatherContent.serverInfo.consumeValue) { UiManager.Instance.createMessageLintWindow(Language("ConsumeRebate_10")); } else { UiManager.Instance.openDialogWindow <BuyWindow> ((win) => { win.init(activeGoods, Mathf.Min(activeGoods.getServerCountCanBuy(), activeGoods.getRoleCountCanBuy(), UserManager.Instance.self.getRMB() / activeGoods.getCostPrice()), 1, activeGoods.getCostType(), buy); }); } }
/// <summary> /// 获得时间描述 /// </summary> public string getTimeDesc() { int nowTime = ServerTimeKit.getSecondTime(); ExamSample examSample = QuizManagerment.Instance.getExamSampleBySid(this); if (examSample == null) { return(LanguageConfigManager.Instance.getLanguage("notice_quiz01")); //活动已经结束 } SidNoticeContent content = getSample().content as SidNoticeContent; TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID); if (activeTime == null) { activeTime = ActiveTime.getActiveTimeByType(tsample); activeTime.initTime(ServerTimeKit.getSecondTime()); } else { activeTime.doRefresh(); } //具体开始时间 int detailStartTime = activeTime.getDetailStartTime(); //具体结束时间 int detailEndTime = activeTime.getDetailEndTime(); if (detailStartTime < nowTime && detailEndTime > nowTime && examSample.getAwardType == 1) { return(LanguageConfigManager.Instance.getLanguage("notice09")); //可以答题 } else if (DateKit.isInSameDay(detailStartTime, nowTime) && detailStartTime > nowTime) { return(LanguageConfigManager.Instance.getLanguage("notice08", TimeKit.dateToFormat(detailStartTime, LanguageConfigManager.Instance.getLanguage("notice05")))); //尚未开启 } else if (activeTime.getIsFinish()) { return(LanguageConfigManager.Instance.getLanguage("notice_quiz01")); //活动已经结束 } else if (detailEndTime < nowTime) { return(LanguageConfigManager.Instance.getLanguage("notice_quiz01")); //活动已经结束 } else { return(LanguageConfigManager.Instance.getLanguage("notice_quiz01")); //活动已经结束 } }
/// <summary> /// 设置活动开启时间 /// </summary> public void setNoticeOpenTime() { this.openTimeNoticeText = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOpen"); this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("superDraw_14"); activeTime = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID); noticeOpenTime = activeTime.getDetailStartTime(); noticeCloseTime = activeTime.getDetailEndTime(); }
public long[] getStarMultipleTimes() { if (starTime == null) { return(null); } return(new long[] { starTime.getDetailStartTime(), starTime.getDetailEndTime() }); }
public override bool isInTimeLimit() { activeTime = getActiveTime(); if (activeTime.getIsFinish()) { return(false); } int now = ServerTimeKit.getSecondTime(); return(activeTime.getDetailStartTime() < now && now < activeTime.getDetailEndTime()); }
public override int[] getTimeLimit() { activeTime = getActiveTime(); if (activeTime.getIsFinish()) { return(null); } return(new int[] { activeTime.getDetailStartTime(), activeTime.getDetailEndTime() }); }
private void updateTime() { activeTime = (notice as ConsumeRebateNotice).activeTime; activeTime.doRefresh(); int now = ServerTimeKit.getSecondTime(); if (activeTime.getEndTime() == 0) { timeLabel.text = Language("notice03"); } else if (now < activeTime.getDetailStartTime()) { //活动还未开启 timeNoOpen.text = Language("ConsumeRebate_05", TimeKit.timeTransformDHMS(activeTime.getDetailStartTime() - now)); timeLabel.gameObject.SetActive(false); offect.SetActive(false); noOpenObj.SetActive(true); //timeLabel.text = Language ("ConsumeRebate_05", TimeKit.timeTransformDHMS (activeTime.getDetailStartTime () - now)); } else if (activeTime.getDetailStartTime() <= now && now < activeTime.getDetailEndTime()) { timeLabel.gameObject.SetActive(true); offect.SetActive(true); offect.transform.localPosition = new Vector3(0f, 17f, 0f); noOpenObj.SetActive(false); timeLabel.text = Language("ConsumeRebate_06", TimeKit.timeTransformDHMS(activeTime.getDetailEndTime() - now)); } else { timeLabel.text = Language("s0211"); timeLabel.gameObject.SetActive(true); offect.SetActive(true); offect.transform.localPosition = new Vector3(0f, 17f, 0f); noOpenObj.SetActive(false); OnDisable(); } }
public void initTime(int _timeId) { timeId = _timeId; timeLimit = new TimeLimit(null); TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(timeId); days = tsample.mainTimeInfoo; activeTime = ActiveTime.getActiveTimeByType(tsample); activeTime.initTime(ServerTimeKit.getSecondTime()); times = new long[] { activeTime.getDetailStartTime(), activeTime.getDetailEndTime() }; updateTime(); }
private void showTime() { int now = ServerTimeKit.getSecondTime(); int start = activeTime.getDetailStartTime(); int end = activeTime.getDetailEndTime(); noOpenTip.SetActive(false); if (now < start) { mTipsStr = ""; //mTipsStr = Language ("doubleRMB_02") + TimeKit.timeTransformDHMS (start - now); noOpenTip.SetActive(true); time.text = Language("doubleRMB_02") + "\n" + TimeKit.timeTransformDHMS(start - now); desc.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_06"); UI_BtnSure.disableButton(true); UI_BtnSure.gameObject.SetActive(false); } else if (start <= now && now <= end) { UI_BtnSure.gameObject.SetActive(true); mTipsStr = Language("doubleRMB_03") + TimeKit.timeTransformDHMS(end - now); desc.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_07"); UI_BtnSure.disableButton(false); } else { UI_BtnSure.gameObject.SetActive(true); mTipsStr = Language("doubleRMB_04"); btnSureName.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_08"); UI_BtnSure.disableButton(true); timer.stop(); timer = null; } if (DoubleRMBManagement.Instance.isEnd) { mTipsStr = Language("doubleRMB_04"); desc.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_08"); btnSureName.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_09"); UI_BtnSure.disableButton(true); } else { btnSureName.text = LanguageConfigManager.Instance.getLanguage("s0324"); } UI_Time.text = mTipsStr; }
public override bool isValid() { NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(sid); activeTime = ActiveTime.getActiveTimeByID(sample.timeID); if (activeTime.getIsFinish()) { return(false); } if (activeTime.getEndTime() == 0) { return(true); } int now = ServerTimeKit.getSecondTime(); return(now >= activeTime.getStartTime() && now <= activeTime.getDetailEndTime() && hasInfo()); }
/// <summary> /// 刷新活动时间 /// </summary> private void refreshNoticeTime() { long remainTime = noticeOpenTime - ServerTimeKit.getSecondTime(); if (remainTime <= 0) { long remainCloseTime = noticeCloseTime - ServerTimeKit.getSecondTime(); if (remainCloseTime >= 0) { timeLabel.text = closeTimeNoticeText.Replace("%1", TimeKit.timeTransformDHMS(remainCloseTime)); } else { //抽奖时间结束,进入只有兑换的阶段 timeLabel.gameObject.SetActive(true); this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("superDraw_15"); int[] sids = (notice.getSample().content as SidNoticeContent).sids; //获取商店的时间sid activeTime = ActiveTime.getActiveTimeByID(sids[0]); int shopCloseTime = activeTime.getDetailEndTime(); long remainShopClosetime = shopCloseTime - ServerTimeKit.getSecondTime(); //获取兑换商店剩余持续时间 timeLabel.text = closeTimeNoticeText.Replace("%1", TimeKit.timeTransformDHMS(remainShopClosetime)); endBottom.gameObject.SetActive(false); endTip.gameObject.SetActive(true); drawButton.disableButton(true); rechargeButton.gameObject.SetActive(false); if (remainShopClosetime <= 0) { timeLabel.gameObject.SetActive(false); timer1.stop(); timer1 = null; } } } //还没开启 else { timeLabel.gameObject.SetActive(true); timeLabel.text = openTimeNoticeText.Replace("%1", TimeKit.timeTransformDHMS(remainTime)); } }
/** 设置活动开启时间 */ public void setNoticeOpenTime() { noticeOpenTime = activeTime.getDetailStartTime(); noticeCloseTime = activeTime.getDetailEndTime(); }
/// <summary> /// 设置活动开启时间 /// </summary> public void setNoticeOpenTime() { activeTime = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID); noticeOpenTime = activeTime.getDetailStartTime(); noticeCloseTime = activeTime.getDetailEndTime(); }