示例#1
0
    protected override void OnOpen(object param = null)
    {
        WindowManager.Instance.CloseUI("challengecountdown");
        mModule = ModuleManager.Instance.FindModule <ChallengeModule>();
        EventDelegate.Add(mBack.onClick, OnBack);
        EventDelegate.Add(Continue.onClick, OnContinue);
        EventDelegate.Add(Sweep.onClick, OnSweep);
        UIEventListener.Get(Background).onClick = OnBackgroundClick;
        EventSystem.Instance.addEventListener(ChallengeEvent.SWEEP_DROP, RefreshBtn);
        mParam = param as ChallengeCompleteParam;
        if (mParam == null)
        {
            return;
        }
        MState        = UIState.ShowDrop;
        FloorNum.text = String.Format(StringHelper.GetString("floornum2"), mParam.mFloor);
        var tableItem = DataManager.ChallengeTable[mParam.mFloor] as ChallengeTableItem;

        if (tableItem != null)
        {
            Scribe.text = tableItem.mDropTip;
        }
        CurScore.text = tableItem.mFloorScore.ToString();
        MaxScore.text = String.Format(StringHelper.GetString("histortyScore"), mParam.mHistortyScore);
        mAwardW.SetShowInfo(mParam);
        AchieveOne.mMaxNum        = tableItem.mAchieveScoreOne;
        AchieveTwo.mMaxNum        = tableItem.mAchieveScoreTwo;
        AchieveThree.mMaxNum      = tableItem.mAchieveScoreThree;
        AchieveOne.mNum.enabled   = mParam.mAchieveOne;
        AchieveTwo.mNum.enabled   = mParam.mAchieveTwo;
        AchieveThree.mNum.enabled = mParam.mAchieveThree;
        mCurStep = UIStep.STEP_ORIGINAL;
    }
    protected override void OnRespond(respond_challenge_stage_sweep respond, object userdata)
    {
        if (respond.challengeinfo != null)
        {
            ChallengeModule module = ModuleManager.Instance.FindModule <ChallengeModule>();
            module.SetDoingFloor(ModuleManager.Instance.FindModule <PlayerDataModule>().GetChallengeCurrentFloor());
        }

        List <ChallengeSweepParam> awarditems = new List <ChallengeSweepParam>();

        if (respond.awards != null)
        {
            for (int i = 0; i < respond.awards.Count; i++)
            {
                challenge_stage_sweep_floor_award flooraward = respond.awards[i];

                ChallengeSweepParam csp = new ChallengeSweepParam();

                csp.mFloor = (int)flooraward.floor;
                if (flooraward.award != null)
                {
                    for (int j = 0; j < flooraward.award.Count; j++)
                    {
                        csp.mDrops.Add(new DropItemParam(flooraward.award[j].resid, flooraward.award[j].num));
                    }
                }

                awarditems.Add(csp);
            }
        }

        WindowManager.Instance.OpenUI("sweepDrop", awarditems);
    }
示例#3
0
 protected override void OnOpen(object param = null)
 {
     WindowManager.Instance.CloseUI("challengecountdown");
     mModule = ModuleManager.Instance.FindModule <ChallengeModule>();
     EventDelegate.Add(mContinue.onClick, OnContinue);
     EventDelegate.Add(mBack.onClick, OnBack);
     mTween.resetOnPlay = true;
     mTween.Play(true);
 }
示例#4
0
 protected override void OnClose()
 {
     base.OnClose();
     mModule = null;
     EventDelegate.Remove(yesBtn.onClick, onYesClick);
     EventDelegate.Remove(noBtn.onClick, onNoClick);
     EventSystem.Instance.removeEventListener(ChallengeEvent.SWEEP_ITEM_NUM, OnSweepNumChange);
     GameObject.Destroy(itemUI.gameObject);
     itemUI = null;
 }
示例#5
0
 public override void trigger()
 {
     if (mUIName == "tower")
     {
         ChallengeModule module = ModuleManager.Instance.FindModule <ChallengeModule>();
         module.OpenUIByFloor(mParamOne);
     }
     {
         WindowManager.Instance.OpenUI(mUIName);
     }
 }
示例#6
0
    //界面打开
    protected override void OnOpen(object param = null)
    {
        base.OnOpen();
        mModule = ModuleManager.Instance.FindModule <ChallengeModule>();
        EventDelegate.Add(yesBtn.onClick, onYesClick);
        EventDelegate.Add(noBtn.onClick, onNoClick);
        EventSystem.Instance.addEventListener(ChallengeEvent.SWEEP_ITEM_NUM, OnSweepNumChange);
        int resId = ConfigManager.GetChallengeSweepNeedItemResID();

        GameDebug.Log("消耗道具:" + resId);
        itemUI = new CommonItemUI(resId);
        itemUI.gameObject.transform.parent        = bg.transform;
        itemUI.gameObject.transform.localScale    = Vector3.one;
        itemUI.gameObject.transform.localPosition = new Vector3(0, 65, 0);

        Refresh();
    }
    protected override void OnOpen(object param = null)
    {
        base.OnOpen(param);
        mFillSprite.fillAmount = 1;
        foreach (var Ani in mAchieveAniList)
        {
            Ani.gameObject.SetActive(true);
            Ani.Reset();
            Ani.Stop();
            Ani.onFinished += OnAniFinish;
        }

        ChallengeModule    module = ModuleManager.Instance.FindModule <ChallengeModule>();
        ChallengeTableItem item   = module.GetChallengeTableItem(module.GetCurFloor());

        mFastTime = item.mAchieveParamOne;
        mMidTime  = item.mAchieveParamTwo;
        mSlowTime = item.mAchieveParamThree;

        State = 0;
    }
示例#8
0
    protected override void OnLoad()
    {
        base.OnLoad();

        mButtonReadMe       = FindComponent <UIButton>("mainContainer/Center/ReadMe");
        mButtonLeftBtn      = FindComponent <UIButton>("mainContainer/Center/PageLeft");
        mButtonRightBtn     = FindComponent <UIButton>("mainContainer/Center/PageRight");
        mLabelMyFight       = FindComponent <UILabel>("mainContainer/Bottom/MyFigh");
        mLabelMyFightTxt    = FindComponent <UILabel>("mainContainer/Bottom/MyFightTxt");
        mLabelRecomFight    = FindComponent <UILabel>("mainContainer/Bottom/RecomFight");
        mLabelScrib         = FindComponent <UILabel>("mainContainer/Bottom/Scrib");
        mLabelState         = FindComponent <UILabel>("mainContainer/Bottom/State/Label");
        mButtonOk           = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/OkBtn");
        mButtonSweep        = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/Sweep");
        mButtonBack         = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/Back");
        mButtonDoAgain      = FindComponent <UIButton>("mainContainer/Bottom/BtnGrid/DoAgain");
        mButtonRank         = FindComponent <UIButton>("mainContainer/Bottom/Paihang");
        mScrolV             = FindComponent <UIScrollView>("mainContainer/Center/Scroll View");
        mGridDrop           = FindComponent <UIGrid>("mainContainer/Bottom/DropGrid");
        mBtnGrid            = FindComponent <UIGrid>("mainContainer/Bottom/BtnGrid");
        mGridFloor          = FindComponent <UIGrid>("mainContainer/Center/Scroll View/Grid");
        mSpriteAchieveOne   = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve1");
        mSpriteAchieveTwo   = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve2");
        mSpriteAchieveThree = FindComponent <UISprite>("mainContainer/Bottom/AchieveGrid/Achieve3");
        mLabelWeekScore     = FindComponent <UILabel>("mainContainer/Bottom/WeekScoreNum");
        mFirstDrop          = FindChild("mainContainer/Bottom/DropGrid/FirstDrop");
        mNormalDrop         = FindChild("mainContainer/Bottom/DropGrid/SecondDrop");
        mBackGround         = FindChild("BackGround");
        mExamRankItem       = FindChild("ViewItem");
        mExamRankItem.SetActive(false);
        mRankTween             = FindComponent <UIPlayTween>("rankContainer");
        mMainTween             = FindComponent <UIPlayTween>("mainContainer");
        mRankLeftTween         = FindComponent <TweenPosition>("rankContainer/left");
        mRankRightTween        = FindComponent <TweenPosition>("rankContainer/right");
        mMainTweenPos          = FindComponent <TweenPosition>("mainContainer");
        mMainTween.resetOnPlay = true;
        mRankTween.resetOnPlay = true;

        mRankNum       = FindComponent <UILabel>("rankContainer/right/ranknum");
        mPlayerName    = FindComponent <UILabel>("rankContainer/right/playername");
        mRankTimer     = FindComponent <UILabel>("rankContainer/right/awardIcon/timer");
        mShowAwardBtn  = FindComponent <UIButton>("rankContainer/right/awardIcon");
        mGoToChalBtn   = FindComponent <UIButton>("rankContainer/right/GotoChallenge");
        mSelfScore     = FindComponent <UILabel>("rankContainer/right/scorebg/Label");
        mScoreTip      = FindComponent <UILabel>("rankContainer/right/tip");
        mPreview       = FindComponent <UISprite>("rankContainer/right/Preview");
        mDizuo         = FindComponent <UISprite>("rankContainer/right/dizuo");
        mRankGuid      = FindComponent <UIGrid>("rankContainer/left/scrollView/itemguid");
        mRanAwardPanel = new ChaRankAwardUI(FindChild("RankAwardPanel"));
        mRanAwardPanel.mGameObject.SetActive(false);


        mExamChallengeBtn = FindChild("floorinfo");
        mExamChallengeBtn.gameObject.SetActive(false);
        mChalModule = ModuleManager.Instance.FindModule <ChallengeModule>();

        mCharacterPreview = new UICharacterPreview();
        mCharacterPreview.BackgroundSprite = mDizuo;
        mCharacterPreview.SetTargetSprite(mPreview);
        mCharacterPreview.SetCameraOrthographicSize(1.2f);
        mCharacterPreview.RotationY = 180;
        mCharacterPreview.Pos       = new Vector3(0, 0.3f, 0);
        mCharacterPreview.Enable    = true;
        //初始化
        InitUI();
    }
示例#9
0
 protected override void OnClose()
 {
     mModule = null;
     EventDelegate.Remove(mContinue.onClick, OnContinue);
     EventDelegate.Remove(mBack.onClick, OnBack);
 }