예제 #1
0
 private void OnGodWeaponLoginPush(short state, GodWeaponLoginPush down = null)
 {
     this.WaitUpGradeRes = false;
     if (state != 0)
     {
         StateManager.Instance.StateShow(state, 0);
         return;
     }
     if (down != null)
     {
         if (this.mTypeLevelDict == null || this.mTypeLevelDict.get_Count() != down.weaponInfo.get_Count())
         {
             this.mTypeLevelDict = new Dictionary <int, Dictionary <int, SShenBingDengJi> >();
             for (int i = 0; i < down.weaponInfo.get_Count(); i++)
             {
                 this.mTypeLevelDict.Add(down.weaponInfo.get_Item(i).Type, new Dictionary <int, SShenBingDengJi>());
             }
             List <SShenBingDengJi> dataList = DataReader <SShenBingDengJi> .DataList;
             for (int j = 0; j < dataList.get_Count(); j++)
             {
                 SShenBingDengJi sShenBingDengJi = dataList.get_Item(j);
                 if (this.mTypeLevelDict.get_Item(sShenBingDengJi.id).ContainsKey(sShenBingDengJi.level))
                 {
                     this.mTypeLevelDict.get_Item(sShenBingDengJi.id).set_Item(sShenBingDengJi.level, sShenBingDengJi);
                 }
                 else
                 {
                     this.mTypeLevelDict.get_Item(sShenBingDengJi.id).Add(sShenBingDengJi.level, sShenBingDengJi);
                 }
             }
         }
         this.mGodList = down.weaponInfo;
         EventDispatcher.Broadcast <int>(EventNames.GodSoldierListNty, this.LastUpGradeType);
     }
 }
예제 #2
0
    private void RefreshDesc(GodWeaponInfo data, bool isSwitch)
    {
        if (GodSoldierManager.Instance.DengjiDict.ContainsKey(data.Type))
        {
            Dictionary <int, SShenBingDengJi> dictionary = GodSoldierManager.Instance.DengjiDict.get_Item(data.Type);
            SShenBingDengJi sShenBingDengJi  = null;
            SShenBingDengJi sShenBingDengJi2 = null;
            if (data.isOpen)
            {
                sShenBingDengJi = dictionary.get_Item(data.gLevel);
            }
            if (data.gLevel < dictionary.get_Count())
            {
                sShenBingDengJi2 = dictionary.get_Item(data.gLevel + 1);
            }
            if (sShenBingDengJi == null)
            {
                this.mTxExp.set_text(data.gExp + "/" + sShenBingDengJi2.EXP);
                this.mExpSlider.set_value((float)data.gExp / (float)sShenBingDengJi2.EXP);
                this.mBtnUpGrade.get_gameObject().SetActive(true);
                this.mGoMaxLevel.SetActive(false);
                this.mTxOpenTips.get_gameObject().SetActive(true);
                this.mTxOpenTips.set_text(this.mLastSelectToggle.Title + "解除封印后获得");
                this.mTxAttrTitle.set_text("解除封印");
                this.mTxUpGrade.set_text("解除封印");
            }
            else if (sShenBingDengJi2 == null)
            {
                this.mTxExp.set_text("MAX");
                this.mExpSlider.set_value(1f);
                this.mBtnUpGrade.get_gameObject().SetActive(false);
                this.mGoMaxLevel.SetActive(true);
                this.mTxOpenTips.get_gameObject().SetActive(true);
                this.mTxOpenTips.set_text("神兵已最大等级");
                this.mTxAttrTitle.set_text("最大等级");
            }
            else if (sShenBingDengJi != null && sShenBingDengJi2 != null)
            {
                this.mTxExp.set_text(data.gExp + "/" + sShenBingDengJi2.EXP);
                this.mExpSlider.set_value((float)data.gExp / (float)sShenBingDengJi2.EXP);
                this.mBtnUpGrade.get_gameObject().SetActive(true);
                this.mGoMaxLevel.SetActive(false);
                this.mTxOpenTips.get_gameObject().SetActive(false);
                this.mTxAttrTitle.set_text("升级属性");
                this.mTxUpGrade.set_text("神兵升级");
                this.UpGradeEffect(data.gLevel);
            }
            this.ClearAttr();
            if (sShenBingDengJi != null && sShenBingDengJi2 != null)
            {
                Attrs attrs = DataReader <Attrs> .Get(sShenBingDengJi.attrID);

                Attrs attrs2 = DataReader <Attrs> .Get(sShenBingDengJi2.attrID);

                if (attrs != null && attrs2 != null)
                {
                    for (int i = 0; i < attrs.attrs.get_Count(); i++)
                    {
                        this.CreateAttr(attrs.attrs.get_Item(i), attrs.values.get_Item(i), true, attrs2.values.get_Item(i));
                    }
                    this.RefreshPowerNumber(data.Type, attrs.attrs, attrs.values, isSwitch);
                }
            }
            else
            {
                Attrs attrs3 = null;
                if (sShenBingDengJi != null)
                {
                    attrs3 = DataReader <Attrs> .Get(sShenBingDengJi.attrID);
                }
                else if (sShenBingDengJi2 != null)
                {
                    attrs3 = DataReader <Attrs> .Get(sShenBingDengJi2.attrID);
                }
                if (attrs3 != null)
                {
                    for (int j = 0; j < attrs3.attrs.get_Count(); j++)
                    {
                        this.CreateAttr(attrs3.attrs.get_Item(j), attrs3.values.get_Item(j), false, 0);
                    }
                    this.RefreshPowerNumber(data.Type, attrs3.attrs, attrs3.values, isSwitch);
                }
            }
        }
    }