Example #1
0
    //解析模板数据
    public override void parseSample(int sid)
    {
        GoddessTrainingSample sample = new GoddessTrainingSample();
        string dataStr = getSampleDataBySid(sid);

        sample.parse(sid, dataStr);
        samples.Add(sid, sample);
    }
Example #2
0
    /** tap点击事件 */
    public override void tapButtonEventBase(GameObject gameObj, bool enable)
    {
        if (!enable)
        {
            return;
        }
        base.tapButtonEventBase(gameObj, enable);
        GoddessTrainingSample sample = GoddessTrainingSampleManager.Instance.getDataBySid(22);

        string[] timeLimitLv = sample.TimeLimitLv;
        if (UserManager.Instance.self.getUserLevel() < StringKit.toInt(timeLimitLv[int.Parse(gameObj.name) - 1]))
        {
            UiManager.Instance.openDialogWindow <MessageLineWindow> ((win) => {
                win.Initialize(LanguageConfigManager.Instance.getLanguage("s0043l4", sample.TrainingTime[int.Parse(gameObj.name) - 1], timeLimitLv[int.Parse(gameObj.name) - 1]));
            });
            updateUI();
            return;
        }
        int tapIndex = int.Parse(gameObj.name) - 1;

        mSelecteTime = tapIndex;
        updateUI();
    }
Example #3
0
    /**刷新时间*/
    private void refreshAwardTime()
    {
        long remainCloseTime = cdTime - ServerTimeKit.getSecondTime();

        if (remainCloseTime >= 0)
        {
            countdownTimeLabel.gameObject.SetActive(true);
            countdownTimeLabel.text = TimeKit.timeTransform(remainCloseTime * 1000);
            rightButton.disableButton(false);
            if (doneLabel.gameObject.activeSelf)
            {
                doneLabel.gameObject.SetActive(false);
            }
        }
        else
        {
            GoddessTrainingSample sample = GoddessTrainingSampleManager.Instance.getDataBySid(22);
            if (UserManager.Instance.self.getUserLevel() >= sample.lvCondition)
            {
                rightButton.disableButton(false);
                if (!doneLabel.gameObject.activeSelf)
                {
                    doneLabel.gameObject.SetActive(true);
                }
                doneLabel.text = LanguageConfigManager.Instance.getLanguage("s0043l1");
            }
            else
            {
                rightButton.disableButton(true);
                doneLabel.gameObject.SetActive(false);
//				doneLabel.text=LanguageConfigManager.Instance.getLanguage("s0043l0",sample.lvCondition.ToString());
            }
            countdownTimeLabel.gameObject.SetActive(false);
        }
        checkLevelCondition();
        checkShenGeLevelCondition();
    }
Example #4
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]);
    }