Exemple #1
0
 public void changeTapPage(TapButtonBase tapButton)
 {
     try {
         changeTapPage(tapButton, true);
     } catch (System.Exception e) {
         Debug.LogWarning(e);
         MaskWindow.UnlockUI();
     }
 }
Exemple #2
0
 public void resetActiveTapPageState()
 {
     if (activeButton != null)
     {
         activeButton.IsActiveTapPage = false;
         activeButton.setTapPageState();
         activeButton = null;
     }
 }
    //void FixedUpdate()
    //{
    //    showAward();
    //}
    /** 更新Tap容器 */
    private void updateTapContent()
    {
//		if(!StarSoulConfigManager.Instance.isEnoughByShowHuntVipLevel()) {
//			tapContent=commonTapContent;
//			currentTapIndex=StarSoulConfigManager.HUNT_MONEY_TYPE;
//			commonTapContent.gameObject.SetActive(true);
//			vipTapContent.gameObject.SetActive(false);
//		} else {
        tapContent = vipTapContent;
        commonTapContent.gameObject.SetActive(false);
        vipTapContent.gameObject.SetActive(true);
        if (!StarSoulConfigManager.Instance.isEnoughByHuntVipLevel())
        {
            TapButtonBase tapButtonBase = vipTapContent.getTapButtonByIndex(1);
            if (tapButtonBase != null)
            {
                tapButtonBase.doEventButNoActive = true;
            }
        }
//		}
    }
Exemple #4
0
    public void changeTapPage(TapButtonBase tapButton, bool sendEvent)
    {
        //忽略已经激活的tap
        if (activeButton == tapButton)
        {
            return;
        }
        //如果点击的按钮要求只走事件不激活
        if (tapButton.doEventButNoActive)
        {
            fatherwindow.tapButtonEventBase(tapButton.gameObject, true);
            return;
        }

        activeButton = tapButton;
        changeAllTapState(sendEvent);
        if (fatherwindow != null)
        {
            fatherwindow.OnTapUpdate();
        }
    }
Exemple #5
0
    /// <summary>
    /// 更新奖励的经验和等级,双倍消耗
    /// </summary>
    public void updateUI()
    {
//		if(tapFalg){
//			tapContent.changeTapPage (tapContent.tapButtonList [mSelecteTime]);
//			tapFalg=false;
//		}
        GoddessTrainingSample samplee = GoddessTrainingSampleManager.Instance.getDataBySid(22);

        string[] timeLimitLvv = samplee.TimeLimitLv;
        if (UserManager.Instance.self.getUserLevel() < StringKit.toInt(timeLimitLvv[mSelecteTime]))
        {
            tapContent.changeTapPage(tapContent.tapButtonList [mSelecteTime]);
            return;
        }
        updateTime();
        if (cdEndTime > ServerTimeKit.getSecondTime())
        {
            goddessSelectButton.disableButton(true);
        }
        else
        {
            goddessSelectButton.disableButton(false);
        }
        if (be == null)
        {
            lvjian.SetActive(false);
            enterButton.disableButton(true);
            headIcon.gameObject.SetActive(false);
            bg.SetActive(true);
            UI_TipsExpLabel.text = "";
            oldExpLabel.text     = "";
            oldLvLabel.text      = "";
            expjian.SetActive(false);
            overLabel.text      = "";
            UI_TipsLvLabel.text = "";
            jiantou.SetActive(false);
            selectLavel.text = LanguageConfigManager.Instance.getLanguage("s0376l8");
        }
        else
        {
            enterButton.disableButton(false);
            bg.SetActive(false);
            headIcon.gameObject.SetActive(true);
            selectLavel.text = be.getName();
            ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH, be, headIcon);
        }
        GoddessTrainingSample sample = GoddessTrainingSampleManager.Instance.getDataBySid(22);

        string[] timeLimitLv = sample.TimeLimitLv;
        for (int i = 0; i < timeLimitLv.Length; i++)  //这里是可以作废的 tap按钮上文字变化
        {
            TapButtonBase tap           = tapContent.getTapButtonByIndex(i);
            TapButtonBase tapButtonBase = tapContent.getTapButtonByIndex(i);
            if (UserManager.Instance.self.getUserLevel() < StringKit.toInt(timeLimitLv[i]))
            {
                tapButtonBase.doEventButNoActive = true;
                tap.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0043l3", sample.TrainingTime[i]);
                tap.disableButton(false);
            }
            else
            {
                tapButtonBase.doEventButNoActive = false;
                tap.textLabel.text = LanguageConfigManager.Instance.getLanguage("s0043l3", sample.TrainingTime[i]);
                tap.disableButton(false);
            }
        }
        needRMBnum.text = LanguageConfigManager.Instance.getLanguage("s037615", sample.TimeRmb [mSelecteTime]);
        if (be == null)
        {
            return;
        }
        Card mCard = be;

        int vipLv = UserManager.Instance.self.vipLevel;
        int lv    = mCard.getLevel();

        mAwardExp = StringKit.toInt(sample.AwardExp [UserManager.Instance.self.getUserLevel() - 1]);
        int trainingTime = StringKit.toInt(sample.TrainingTime [mSelecteTime]);

        mAwardExp *= trainingTime;
        if (isDouble)
        {
            mAwardExp *= 2;
        }
        long  exp         = mCard.getEXP();
        float vipAwardExp = vipLv > 0 ? VipManagerment.Instance.getVipbyLevel(vipLv).privilege.expAdd * 0.0001f + 1 : 1;

        mAwardExp = (long)(vipAwardExp * mAwardExp);

        //最大能获取的经验值
        long AwardMaxExp = mAwardExp;

        mExpOverflow = false;

        long tmpExp = mCard.checkExp(mAwardExp);

        if (tmpExp != -1)
        {
            AwardMaxExp  = tmpExp;
            mExpOverflow = true;
        }

        //        mExpOverflow = AwardMaxExp < awardExp + exp;
        mMaxAwardExp = AwardMaxExp;
        mIsUpgrade   = mMaxAwardExp >= mCard.getNeedExp();
        if (mIsUpgrade)
        {
            jiantou.SetActive(true);
        }
        else
        {
            jiantou.SetActive(false);
        }
        //UI_TipsExpLabel.text = "+" + mAwardExp;
        oldExpLabel.text     = exp.ToString();
        UI_TipsExpLabel.text = (exp + mAwardExp).ToString();
        if (vipLv > 0)
        {
            if (!mExpOverflow)
            {
                //"+" + ((long)(mAwardExp / vipAwardExp))
                UI_TipsExpLabel.text = (exp + ((long)(mAwardExp / vipAwardExp))).ToString();
            }
            UI_TipsExpLabel.text += " x" + (vipAwardExp) + "(VIP" + vipLv.ToString() + ")";
        }

        int nextLv = 0;

        if (tmpExp != -1)
        {
            nextLv = EXPSampleManager.Instance.getLevel(mCard.getEXPSid(), tmpExp);
        }
        else
        {
            nextLv = EXPSampleManager.Instance.getLevel(mCard.getEXPSid(), mMaxAwardExp + exp);
        }
        //UI_TipsLvLabel.text = string.Format ("LV{0}             LV{1}", lv, nextLv);
        UI_TipsLvLabel.text = "Lv." + nextLv.ToString();
        oldLvLabel.text     = "Lv." + lv.ToString();
        if (mIsUpgrade)
        {
            lvjian.SetActive(true);
            lvjian.transform.localPosition = UI_TipsLvLabel.transform.localPosition + new Vector3(UI_TipsLvLabel.width + 10f, 0f, 0f);
        }
        else
        {
            lvjian.SetActive(false);
        }
        if (mAwardExp > 0)
        {
            expjian.SetActive(true);
            expjian.transform.localPosition = UI_TipsExpLabel.transform.localPosition + new Vector3(UI_TipsExpLabel.width + 10f, 0f, 0f);
        }
        else
        {
            expjian.SetActive(false);
        }
        if (mExpOverflow)
        {
            overLabel.text = "[ff0000]" + Language("cardtraining_expOverflow", (exp + mAwardExp) - AwardMaxExp) + "[-]";
//			if(expjian.activeInHierarchy){
//				overLabel.transform.localPosition=expjian.transform.localPosition+new Vector3(36f,0f,0f);
//			}else{
//				overLabel.transform.localPosition=UI_TipsExpLabel.transform.localPosition+new Vector3(UI_TipsExpLabel.width+10f,0f,0f);
//			}
//			UI_TipsExpLabel.text = "[ff0000]" + UI_TipsExpLabel.text + Language ("cardtraining_expOverflow", (exp + mAwardExp) - AwardMaxExp) + "[-]";
//			UI_TipsLvLabel.text = "[ff0000]" + UI_TipsLvLabel.text + "[-]";
            //UI_TipsExpLabel.text = "[ff0000]" + UI_TipsExpLabel.text + Language ("cardtraining_expOverflow", (exp + mAwardExp) - AwardMaxExp) + "[-]";
            //UI_TipsLvLabel.text = "[ff0000]" + UI_TipsLvLabel.text + "[-]";
        }
        else
        {
            overLabel.text = "";
        }

        //	UI_RmbLabel.text = string.Format (LanguageConfigManager.Instance.getLanguage ("CardTraining_07"), sample.TimeRmb [mSelecteTime]);
    }
Exemple #6
0
 public void resetTap()
 {
     activeButton = null;
 }