Exemple #1
0
    void UpdateNeedItem(COM_Item item)
    {
        COM_CrystalData data = GemSystem.instance.CrystalData;

        if (data == null)
        {
            return;
        }
        CrystalUpData cData   = CrystalUpData.GetData((int)data.level_ + 1);
        int           haveNum = BagSystem.instance.GetItemMaxNum(21365);

        needGem.text = haveNum + "/" + cData.DebrisNum.ToString();
        if (haveNum < cData.DebrisNum)
        {
            levelUpBtn.isEnabled = false;
            needGem.color        = Color.red;
        }
        else
        {
            needGem.color = Color.grey;
        }
    }
Exemple #2
0
    private void UpdateInfo()
    {
        COM_CrystalData data = GemSystem.instance.CrystalData;

        //data.level_ = 2;
        if (data == null)
        {
            return;
        }
        gemIcon.spriteName      = "baoshi_lv" + data.level_;
        gemLevelIcon.spriteName = "dengji_" + data.level_;

        for (int e = 1; e < gemEffectObj.Count; e++)
        {
            gemEffectObj[e].gameObject.SetActive(false);
        }
        if (data.level_ > 1)
        {
            gemEffectObj[(int)data.level_ - 1].gameObject.SetActive(true);
        }

        CrystalUpData cData = CrystalUpData.GetData((int)data.level_ + 1);

        //if(cData == null)
        //{
        //return;
        //}
        if (levelUpObj.activeSelf)
        {
            for (int j = 0; j < levelUpProp.Count; j++)
            {
                levelUpProp[j].gameObject.SetActive(false);
                gemProp[j].gameObject.SetActive(false);
            }
            for (int i = 0; i < data.props_.Length; i++)
            {
                levelUpProp[i].gameObject.SetActive(true);
                gemProp[i].gameObject.SetActive(true);
                gemPropCellUI cell = gemProp[i].GetComponent <gemPropCellUI>();
                cell.propName.text = LanguageManager.instance.GetValue(data.props_[i].type_.ToString());
                cell.propNum.text  = "+" + data.props_[i].val_;
                gemProp[i].GetComponent <UISprite>().spriteName = getPropString((int)data.props_[i].level_);
                gemPropCellUI cell0 = levelUpProp[i].GetComponent <gemPropCellUI>();
                cell0.propName.text = LanguageManager.instance.GetValue(data.props_[i].type_.ToString());
                cell0.propNum.text  = "+" + data.props_[i].val_;
                levelUpProp[i].GetComponent <UISprite>().spriteName = getPropString((int)data.props_[i].level_);
                CrystalData qjData = CrystalData.GetData((int)data.props_[i].type_, (int)data.props_[i].level_);
                if (qjData == null)
                {
                    continue;
                }
                string[] strArr = qjData.property.Split(';');
                cell0.qjLab.text = "(" + strArr[0] + "-" + strArr[1] + ")";
            }
            levelUpBtn.isEnabled = true;
            if (cData == null)
            {
                levelUpBtn.isEnabled = false;
                levelUpNeedObj.gameObject.SetActive(false);
                maxLevelLab.gameObject.SetActive(true);
                return;
            }
            else
            {
                levelUpNeedObj.gameObject.SetActive(true);
                maxLevelLab.gameObject.SetActive(false);
            }
            needMoneyLab.text = cData.GodNum.ToString();
            if (GamePlayer.Instance.GetIprop(PropertyType.PT_Money) < cData.GodNum)
            {
                levelUpBtn.isEnabled = false;
                needMoneyLab.color   = Color.red;
            }
            else
            {
                needMoneyLab.color = Color.grey;
            }
            int haveNum = BagSystem.instance.GetItemMaxNum(21365);
            needGem.text = haveNum + "/" + cData.DebrisNum.ToString();
            if (haveNum < cData.DebrisNum)
            {
                levelUpBtn.isEnabled = false;
                needGem.color        = Color.red;
            }
            else
            {
                needGem.color = Color.grey;
            }
            cgLab.text = cData.Mission + "%";
        }
        else
        {
            for (int j = 0; j < changeProp.Count; j++)
            {
                changeProp[j].gameObject.SetActive(false);
            }
            for (int i = 0; i < data.props_.Length; i++)
            {
                gemProp[i].gameObject.SetActive(true);
                gemPropCellUI cell = gemProp[i].GetComponent <gemPropCellUI>();
                cell.propName.text = LanguageManager.instance.GetValue(data.props_[i].type_.ToString());
                cell.propNum.text  = "+" + data.props_[i].val_;
                gemProp[i].GetComponent <UISprite>().spriteName = getPropString((int)data.props_[i].level_);

                changeProp[i].gameObject.SetActive(true);
                gemPropCellUI cell0 = changeProp[i].GetComponent <gemPropCellUI>();
                cell0.propName.text = LanguageManager.instance.GetValue(data.props_[i].type_.ToString());
                cell0.propNum.text  = "+" + data.props_[i].val_;
                changeProp[i].GetComponent <UISprite>().spriteName = getPropString((int)data.props_[i].level_);
            }
            if (data.props_.Length <= 1)
            {
                lockBtns[0].gameObject.SetActive(false);
            }
            else
            {
                if (data.props_.Length - lockNumList.Count > 1)
                {
                    for (int i = 0; i < lockBtns.Count; i++)
                    {
                        if (!lockNumList.Contains(i))
                        {
                            lockBtns[i].gameObject.SetActive(true);
                        }
                    }
                }
            }

            int num = data.props_.Length - lockNumList.Count;
            changeNeedLab.text = (20 * (Math.Pow(2, lockNumList.Count))).ToString();

            for (int i = 0; i < lockImg.Count; i++)
            {
                lockImg[i].gameObject.SetActive(false);
                if (lockNumList.Contains(i))
                {
                    lockImg[i].gameObject.SetActive(true);
                }
            }
        }
    }