示例#1
0
 protected override void begin()
 {
     base.begin();
     if (!isAwakeformHide)
     {
         if (firstBootIndex > 0)
         {
             initTopButton(true, firstBootIndex, entranceId);
         }
         else
         {
             initTopButton();
         }
     }
     else
     {
         if (lastSelect != null)
         {
             Notice _notice = lastSelect.getNotice();
             int    type    = _notice.getSample().type;
             doSwitchBackGround(type);
             if (lastSelect.getNotice().getSample().type == NoticeType.BACK_RECHARGE)               // 当返回的是回归充值界面//
             {
                 lastSelect.updateTime();
                 showDetail(lastSelect);
             }
         }
     }
     MaskWindow.UnlockUI();
     GuideManager.Instance.guideEvent();
 }
示例#2
0
 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); });
     }
 }
示例#3
0
    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;
    }