/// <summary> /// 更新默认选项,断线重连特殊处理 /// </summary> /// <param name="type">Type.</param> public void updateDefaulSelect(int type) { defaultSelectSid = type; NoticeTopButton selectBtn = tabButtons [defaultSelectSid] as NoticeTopButton; showDetail(selectBtn); }
public void initContent(Notice notice, WindowBase win, NoticeTopButton button) { this.button = button; this.fatherWin = win; endTimes = BackPrizeLoginInfo.Instance.endTimes; backPrizeContent.reLoad(fatherWin, this.button); }
public void reLoad(WindowBase win, NoticeTopButton button) { this.button = button; fatherWin = win; prizeList = BackPrizeLoginInfo.Instance.prizeList; base.reLoad(prizeList.Count); }
public override void buttonEventBase(GameObject gameObj) { base.buttonEventBase(gameObj); if (gameObj.name == "close") { //如果是登录弹窗,关闭后开mainwindow if (firstBootIndex >= 0) { UiManager.Instance.openMainWindow(); firstBootIndex = -1; } else if (fatherWindow != null && fatherWindow is TaskWindow) { UiManager.Instance.backGround.switchBackGround("backGround_1"); } finishWindow(); } else if (gameObj.name.StartsWith("notice")) { NoticeTopButton button = gameObj.GetComponent <NoticeTopButton> (); //点击的不是当前显示的活动 if (lastSelect.getNotice().sid != button.getNotice().sid) { showDetail(button); } MaskWindow.UnlockUI(); } else if (gameObj.name.StartsWith("Quiz_")) { int type = lastSelect.getNotice().getSample().type; if (type == NoticeType.QUIZ_EXAM || type == NoticeType.QUIZ_SURVEY) { show.GetComponent <NoticeQuizContent> ().clickButton(gameObj); } } else if (gameObj.name == "buttonRecharge") { UiManager.Instance.openWindow <rechargeWindow> (); } else if (gameObj.name == "ButtonBuymaterial") { UiManager.Instance.openWindow <ShopWindow> ((win) => { win.setCallBack(null); }); } }
private void updateTabButtonView() { NoticeTopButton selectBtn = tabButtons [defaultSelectSid] as NoticeTopButton; UIGrid grid = content.GetComponent <UIGrid> (); UIScrollView scrollView = topButtons.transform.GetComponent <UIScrollView> (); float toX = selectBtn.local_x; float min_X = grid.cellWidth * tabButtons.Keys.Count; Vector4 clip = scrollView.panel.finalClipRegion; if (min_X - toX < clip.z) { toX = min_X - clip.z + scrollView.panel.clipSoftness.x; } scrollView.MoveRelative(new Vector3(-toX, 0, 0)); showDetail(selectBtn); topButtons.transform.localPosition = Vector3.zero; topButtons.GetComponent <UIPanel>().clipOffset = Vector2.zero; }
// item的更新和初始化// public void updateItem(BackPrize bp, WindowBase win, NoticeTopButton button) { if (button != null) { this.button = button; } this.fatherWin = win; this.bp = bp; awardButton.fatherWindow = win; awardButton.onClickEvent = receviedClick; if (bp != null) { if (bp.isRecevied == BackPrizeRecevieType.RECEVIE) // 领取// { awardButton.disableButton(false); //awardButtonBg.spriteName = recevie_spriteName; awardButtonLabel.text = LanguageConfigManager.Instance.getLanguage("s0309"); } else if (bp.isRecevied == BackPrizeRecevieType.RECEVIED) // 已领取// { awardButton.disableButton(true); //awardButtonBg.spriteName = recevied_spriteName; awardButtonLabel.text = LanguageConfigManager.Instance.getLanguage("recharge02"); } else if (bp.isRecevied == BackPrizeRecevieType.CANT_RECEVIE) // 不能领取// { awardButton.disableButton(true); //awardButtonBg.spriteName = recevied_spriteName; awardButtonLabel.text = LanguageConfigManager.Instance.getLanguage("s0309"); } todayTitle.text = bp.dayID.ToString(); for (int i = 0; i < bp.prizes.Length; i++) { goods[i].gameObject.SetActive(true); goods[i].init(bp.prizes[i]); goods[i].fatherWindow = win; } } }
private void showDetail(NoticeTopButton button) { Notice notice = button.getNotice(); int type = notice.getSample().type; doSwitchBackGround(type); if (type == NoticeType.TOPUPNOTICE || type == NoticeType.COSTNOTICE || type == NoticeType.TIME_RECHARGE || type == NoticeType.NEW_RECHARGE || type == NoticeType.NEW_CONSUME) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, rechargeShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeActivityRechargeContent> ().initContent(notice, this); } else if (type == NoticeType.EXCHANGENOTICE || type == NoticeType.NEW_EXCHANGE) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, exchangeShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeActivityExchangeContent> ().initContent(notice, this); } else if (type == NoticeType.HEROEAT) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, heroEatShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <HeroEatContent> ().initContent(this); } else if (type == NoticeType.ALCHEMY) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, alchemyShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <AlchemyContent> ().initContent(this); } else if (type == NoticeType.CDKEY) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, inviteShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <InviteContent> ().initWindow(0, this); } else if (type == NoticeType.MONTHCARD) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, monthCardShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <MonthCardContent> ().initContent(this); } else if (type == NoticeType.HAPPY_TURN_SPRITE || type == NoticeType.XIANSHI_HAPPY_TURN) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, happyTurnSpriteShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <HappyTurnSpriteContent> ().initContent(notice, this); } else if (type == NoticeType.ONERMB) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, oneRmbShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <OneRmbContent> ().initContent(this); } else if (type == NoticeType.QUIZ_EXAM) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, quizShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeQuizContent> ().initData(this, notice); } else if (type == NoticeType.QUIZ_SURVEY) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, quizShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeQuizContent> ().initData(this, notice); } else if (type == NoticeType.HAPPY_SUNDAY) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, happySunday); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <HappySundayContent> ().initContent(this, notice); } else if (type == NoticeType.CONSUME_REBATE) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, consumeRebateShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeConsumeRebateContent> ().initContent(notice, this); } else if (type == NoticeType.LUCKY_CARD) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, luckyCardShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <LuckyCardContent> ().initContent(this, notice); } else if (type == NoticeType.LUCKY_EQUIP || type == NoticeType.XIANSHI_HUODONG) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, luckyEquipShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <LuckyEquipContent> ().initContent(this, notice); } else if (type == NoticeType.DOUBLE_RMB) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, doubleRMB); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <DoubleRMBContent> ().initContent(this, notice); } else if (type == NoticeType.REMAKE_EQUIP) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, equipRemakeShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <EquipRemakeContent> ().initContent(this, notice); } else if (type == NoticeType.DAILY_REBATE) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, dailyReateShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; //(FPortManager.Instance.getFPort ("InitLuckyDrawFPort") as InitLuckyDrawFPort).init (null); dailyRateList = TaskManagerment.Instance.getDailyRebateTask(); show.GetComponent <NoticeActivityDailyRebateContent> ().initContent(notice, this, dailyRateList); } else if (type == NoticeType.LADDER_HEGEMONY) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, ladderHegemoney); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; NoticeSample sample = NoticeSampleManager.Instance.getNoticeSampleBySid(notice.sid); Notice activenotice = NoticeManagerment.Instance.getNoticeListByType(NoticeType.LADDER_ACTION_TIME, notice.sid, sample.entranceId); show.GetComponent <NoticeLadderHegeMoneyContent> ().initContent(notice, this); show.GetComponent <NoticeLadderHegeMoneyContent> ().initActiveNotice(activenotice); } else if (type == NoticeType.LIMIT_COLLECT) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, limitCollect); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeActivityLimitCollectContent> ().initContent(notice, this); } else if (type == NoticeType.ONE_MANY_RECHARGE) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, oneManyShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeOneManyRechargeContent>().initContent(notice, this); } else if (type == NoticeType.FESTIVAL_WISH) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, festivalShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeActivityFestivalWishContent>().initContent(notice, this); } else if (type == NoticeType.FESTIVAL_FIREWORKS) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, fireworksShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeActivityFestivalFireworksContent>().initContent(notice, this); } else if (type == NoticeType.SUPERDRAW) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, superDrawShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeActivitySuperDrawContent>().initContent(notice, this); } else if (type == NoticeType.XIANSHI_FANLI) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, rebateShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <RebateContent>().initContent(notice, this); } else if (type == NoticeType.SIGNIN) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, signInShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <NoticeActivitySignInContent>().initContent(notice, this); } else if (type == NoticeType.SHAREDRAW) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, shareContent); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <ShareDrawContent>().initContent(notice, this); } else if (type == NoticeType.BACK_PRIZE) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, backPrizeShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <OldPlayerBackContent>().initContent(notice, this, button); } else if (type == NoticeType.BACK_RECHARGE) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, backRechargeShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <BackRechargeContent>().initContent(notice, this); } else if (type == NoticeType.WEEKCARD) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, weekCardShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; show.GetComponent <WeekCardContent>().initContent(this); } else if (type == NoticeType.LOTTERY) { Destroy(show); show = NGUITools.AddChild(showPos.gameObject, lotteryShow); show.transform.localPosition = Vector3.zero; show.transform.localScale = Vector3.one; LotteryInfoFPort fPort = FPortManager.Instance.getFPort("LotteryInfoFPort") as LotteryInfoFPort; fPort.lotteryInfoAccess(() => { LotteryManagement.Instance.canGetInitFPort = false; show.GetComponent <LotteryContent>().initContent(this, notice); }); } else { MessageWindow.ShowAlert(LanguageConfigManager.Instance.getLanguage("s0358")); return; } if (lastSelect != null) { lastSelect.selelct.gameObject.SetActive(false); } button.selelct.gameObject.SetActive(true); lastSelect = button; }