Пример #1
0
        private void SetParam(ConceptCardData card_data, UnitData unit, int job_index)
        {
            if (card_data == null || unit == null || unit.Jobs.Length <= job_index)
            {
                return;
            }
            JobData job = unit.Jobs[job_index];

            this.mName.set_text(card_data.Param.name);
            this.mLvText.set_text(card_data.Lv.ToString());
            this.mLvMaxText.set_text(card_data.CurrentLvCap.ToString());
            if (Object.op_Inequality((Object)this.mTrustObject, (Object)null))
            {
                this.mTrustObject.SetActive(card_data.GetReward() != null);
            }
            ConceptCardManager.SubstituteTrustFormat(card_data, this.mTrustText, (int)card_data.Trust, false);
            int   num1 = 0;
            float num2 = 1f;

            if ((int)card_data.Lv < (int)card_data.CurrentLvCap)
            {
                int conceptCardLevelExp1 = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardLevelExp((int)card_data.Rarity, (int)card_data.Lv);

                int conceptCardLevelExp2 = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardLevelExp((int)card_data.Rarity, (int)card_data.Lv + 1);

                num2 = (float)((int)card_data.Exp - conceptCardLevelExp1) / (float)(conceptCardLevelExp2 - conceptCardLevelExp1);
                num1 = conceptCardLevelExp2 - (int)card_data.Exp;
            }
            this.mExpText.set_text(num1.ToString());
            this.mExpSlider.set_value(num2);
            if (Object.op_Inequality((Object)this.mIcon, (Object)null))
            {
                this.mIcon.Setup(card_data);
            }
            this.mBaseAdd.Clear();
            this.mBaseMul.Clear();
            this.mUnitAdd.Clear();
            this.mUnitMul.Clear();
            BaseStatus fixed_status = new BaseStatus();
            BaseStatus scale_status = new BaseStatus();
            List <ConceptCardEquipEffect> enableEquipEffects = card_data.GetEnableEquipEffects(unit, job);

            for (int index = 0; index < enableEquipEffects.Count; ++index)
            {
                enableEquipEffects[index].GetStatus(ref fixed_status, ref scale_status);
                this.mBaseAdd.Add(fixed_status);
                this.mBaseMul.Add(scale_status);
            }
            this.mStatus.SetValues(this.mBaseAdd, this.mBaseMul, this.mUnitAdd, this.mUnitMul, false);
        }
        public void SetData(ConceptCardData data)
        {
            ConceptCardTrustRewardItemParam reward = data.GetReward();

            if (reward == null)
            {
                return;
            }
            switch (reward.reward_type)
            {
            case eRewardType.Item:
                this.SetItem(reward);
                break;

            case eRewardType.Artifact:
                this.SetArtifact(reward);
                break;

            case eRewardType.ConceptCard:
                this.SetConceptCard(reward);
                break;
            }
            this.mItemAmount.set_text(reward.reward_num.ToString());
        }
Пример #3
0
        public static void SubstituteTrustFormat(ConceptCardData card, Text txt, int trust, bool notChangeColor = false)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object)txt, (UnityEngine.Object)null) || card == null)
            {
                return;
            }
            string trustFormat = ConceptCardManager.ParseTrustFormat(trust);

            txt.set_text(trustFormat);
            if (notChangeColor)
            {
                return;
            }
            if (trust >= (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.CardTrustMax && card.GetReward() != null)
            {
                ((Graphic)txt).set_color(Color.get_red());
            }
            else
            {
                ((Graphic)txt).set_color(Color.get_white());
            }
        }