/// <summary>
        ///进阶前属性显示
        /// </summary>
        public void OldShow()
        {
            HeroTemplate _hero     = _Card.GetHeroRow();
            HeroData     _heroDate = _Card.GetHeroData();

            mLevelOld.text = _Card.GetHeroData().Level + "/" + _hero.getMaxLevel();
            mHpOld.text    = (_Card.GetBaseMaxHP() - _heroDate.TrainingMaxHP).ToString();
            int nPhysicalTraniningValue = 0;

            if (_hero.getClientSignType()[1] == 0)
            {
                nPhysicalTraniningValue = _heroDate.TrainingPhysicalAttack;
            }
            mPhysicsAttacksOld.text = (_Card.GetPhysicalBaseAttack() - nPhysicalTraniningValue).ToString();
            int nMagicTraniningValue = 0;

            if (_hero.getClientSignType()[1] == 1)
            {
                nMagicTraniningValue = _heroDate.TrainingMagicAttack;
            }
            mMagicAttacksOld.text   = (_Card.GetMagicBaseAttack() - nMagicTraniningValue).ToString();
            mPhysicsDefenseOld.text = (_Card.GetPhysicalBaseDefence() - _heroDate.TrainingPhysicalDefence).ToString();
            mMagicDefenseOld.text   = (_Card.GetMagicBaseDefence() - _heroDate.TrainingMagicDefence).ToString();
            mAccuracyOld.text       = _Card.GetBaseHit().ToString();
            mEvaOld.text            = _Card.GetBaseDodge().ToString();
            mCritOld.text           = _Card.GetBaseCritical().ToString();
            mTenacityOld.text       = _Card.GetBaseTenacity().ToString();
            mVelocityOld.text       = _Card.GetBaseSpeed().ToString();
            int m_HeroStar = _hero.getQuality();
            int maxStar    = _hero.getMaxQuality();

            //星级品质界面控制
            for (int i = 0; i < 5; i++)
            {
                mStarListOld[i].SetActive(i + 1 <= m_HeroStar);
                mStarBGListOld[i].SetActive(i + 1 <= maxStar);
            }
            //for (int i = 0; i < mStarListOld.Count; i++)
            //{
            //    if (i < _hero.getQuality())
            //    {
            //        mStarListOld[i].SetActive(true);
            //    }
            //    else
            //    {
            //        mStarListOld[i].SetActive(false);
            //    }
            //}
            mSkillMaxOld.text = _hero.getSkillMaxLevel().ToString();
        }
Exemplo n.º 2
0
        //public void OnClickSelf()
        //{
        //    UI_HomeControler.Inst.AddUI("UI_Home/UI_ItemMessage_2_2");
        //    UI_Item._instance.UpdateShow(mItem);

        //}

        //显示英雄信息界面详细信息界面
        public void InitCardDetailedData(int num, ObjectCard _card)
        {
            CardDetailedDataName      = selfTransform.FindChild("Name").GetComponent <Text>();
            CardDetailedDataBaseValue = selfTransform.FindChild("BaseValue").GetComponent <Text>();
            CardDetailedDataBuffValue = selfTransform.FindChild("BuffValue").GetComponent <Text>();
            switch (num)
            {
            case 1:    //生命值
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute1des");
                CardDetailedDataBaseValue.text = _card.GetBaseMaxHP().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetMaxHP() - _card.GetBaseMaxHP()).ToString();
            }
            break;

            case 2:    //物理攻击力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute2des");
                CardDetailedDataBaseValue.text = _card.GetPhysicalBaseAttack().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetPhysicalAttack() - _card.GetPhysicalBaseAttack()).ToString();
            }
            break;

            case 3:    //法术攻击力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute4des");
                CardDetailedDataBaseValue.text = _card.GetMagicBaseAttack().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetMagicAttack() - _card.GetMagicBaseAttack()).ToString();
            }
            break;

            case 4:    //物理防御力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute3des");
                CardDetailedDataBaseValue.text = _card.GetPhysicalBaseDefence().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetPhysicalDefence() - _card.GetPhysicalBaseDefence()).ToString();
            }
            break;

            case 5:    //法术防御力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute5des");
                CardDetailedDataBaseValue.text = _card.GetMagicBaseDefence().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetMagicDefence() - _card.GetMagicBaseDefence()).ToString();
            }
            break;

            case 6:    //命中
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute6des");
                CardDetailedDataBaseValue.text = _card.GetBaseHit().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetHit() - _card.GetBaseHit()).ToString();
            }
            break;

            case 7:    //闪避
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute7des");
                CardDetailedDataBaseValue.text = _card.GetBaseDodge().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetDodge() - _card.GetBaseDodge()).ToString();
            }
            break;

            case 8:    //暴击
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute8des");
                CardDetailedDataBaseValue.text = _card.GetBaseCritical().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetCritical() - _card.GetBaseCritical()).ToString();
            }
            break;

            case 9:    //暴击伤害率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute16des");
                CardDetailedDataBaseValue.text = _card.GetCriticalHurtAddRate() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetCriticalHurtAddRate() - _card.GetCriticalHurtAddRate()).ToString();
            }
            break;

            case 10:    //韧性
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute9des");
                CardDetailedDataBaseValue.text = _card.GetBaseTenacity().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetTenacity() - _card.GetBaseTenacity()).ToString();
            }
            break;

            case 11:    //速度
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute10des");
                CardDetailedDataBaseValue.text = _card.GetBaseSpeed().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetSpeed() - _card.GetBaseSpeed()).ToString();
            }
            break;

            case 12:    //生命恢复力
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute11des");
                CardDetailedDataBaseValue.text = _card.GetHpRecover().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetHpRecover() - _card.GetHpRecover()).ToString();
            }
            break;

            case 13:    //初始怒气值
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute25des");
                CardDetailedDataBaseValue.text = _card.GetInitPowerAddition().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetInitPowerAddition() - _card.GetInitPowerAddition()).ToString();
            }
            break;

            case 14:    //物理伤害加深率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute20des");
                CardDetailedDataBaseValue.text = _card.GetPhysicalHurtAddPermil() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetPhysicalHurtAddPermil() - _card.GetPhysicalHurtAddPermil()).ToString();
            }
            break;

            case 15:    //法术伤害加深率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute18des");
                CardDetailedDataBaseValue.text = _card.GetMagicHurtAddPermil() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetMagicHurtAddPermil() - _card.GetMagicHurtAddPermil()).ToString();
            }
            break;

            case 16:    //伤害附加值
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute21des");
                CardDetailedDataBaseValue.text = _card.GetExtraHurt().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetExtraHurt() - _card.GetExtraHurt()).ToString();
            }
            break;

            case 17:    //物理伤害减免率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute17des");
                CardDetailedDataBaseValue.text = _card.GetPhysicalHurtReducePermil() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetPhysicalHurtReducePermil() - _card.GetPhysicalHurtReducePermil()).ToString();
            }
            break;

            case 18:    //法术伤害减免率
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute19des");
                CardDetailedDataBaseValue.text = _card.GetMagicHurtReducePermil() * 100 + "%";
                CardDetailedDataBuffValue.text = "+" + (_card.GetMagicHurtReducePermil() - _card.GetMagicHurtReducePermil()).ToString();
            }
            break;

            case 19:    //伤害减免值
            {
                CardDetailedDataName.text      = GameUtils.getString("baseattribute22des");
                CardDetailedDataBaseValue.text = _card.GetReduceHurtPoint().ToString();
                CardDetailedDataBuffValue.text = "+" + (_card.GetReduceHurtPoint() - _card.GetReduceHurtPoint()).ToString();
            }
            break;
            }
        }
        /// <summary>
        /// 进阶后的属性显示
        /// </summary>
        public void NewShow()
        {
            HeroTemplate _hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(_Card.GetHeroRow().getStageUpTargetID());
            int          level = 0;

            switch (_hero.getQuality())
            {
            case 2:
                mSkill.SetActive(false);
                break;

            case 3:
                mSkill.SetActive(true);
                int           skillID3 = _hero.getSkill2ID();
                SkillTemplate skill3   = (SkillTemplate)DataTemplate.GetInstance().m_SkillTable.getTableData(skillID3);
                mSkillBg.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + skill3.getSkillIcon());
                mSkillLevel.text        = skill3.getSkillLevel().ToString();
                mSkillName.text         = GameUtils.getString(skill3.getSkillName());
                mSkillType.text         = GameUtils.getString("common_skilltypename_1");
                UI_SkillTips _tips3 = new UI_SkillTips(_Card, skill3);
                mSkillDesText.text = _tips3.SetShow();
                level = DataTemplate.GetInstance().m_GameConfig.getHero_advanced_level_3();

                break;

            case 4:
                mSkill.SetActive(true);
                int skillID4 = _hero.getSkill3ID();
                if (skillID4 != -1)
                {
                    SkillTemplate skill4 = (SkillTemplate)DataTemplate.GetInstance().m_SkillTable.getTableData(skillID4);
                    mSkillBg.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + skill4.getSkillIcon());
                    mSkillLevel.text        = skill4.getSkillLevel().ToString();
                    mSkillName.text         = GameUtils.getString(skill4.getSkillName());
                    mSkillType.text         = GameUtils.getString("common_skilltypename_3");
                    UI_SkillTips _tips4 = new UI_SkillTips(_Card, skill4);
                    mSkillDesText.text = _tips4.SetShow();
                }
                else
                {
                    mSkill.SetActive(false);
                }
                level = DataTemplate.GetInstance().m_GameConfig.getHero_advanced_level_4();
                break;

            case 5:
                level = DataTemplate.GetInstance().m_GameConfig.getHero_advanced_level_5();
                mSkill.SetActive(false);
                break;

            default:
                break;
            }
            Hero hero = new Hero();

            hero.heroid     = _Card.GetHeroRow().getStageUpTargetID();
            hero.herolevel  = level;
            hero.heroviewid = _hero.getArtresources();
            // ObjectCard obj = new ObjectCard();
            obj.GetHeroData().Init(hero);


            HeroData _heroDate = obj.GetHeroData();

            mLevelNew.text = obj.GetHeroData().Level + "/" + _hero.getMaxLevel();
            mHpNew.text    = (obj.GetBaseMaxHP() - _heroDate.TrainingMaxHP).ToString();
            int nPhysicalTraniningValue = 0;

            if (_hero.getClientSignType()[1] == 0)
            {
                nPhysicalTraniningValue = _heroDate.TrainingPhysicalAttack;
            }
            mPhysicsAttacksNew.text = (obj.GetPhysicalBaseAttack() - nPhysicalTraniningValue).ToString();
            int nMagicTraniningValue = 0;

            if (_hero.getClientSignType()[1] == 1)
            {
                nMagicTraniningValue = _heroDate.TrainingMagicAttack;
            }
            mMagicAttacksNew.text   = (obj.GetMagicBaseAttack() - nMagicTraniningValue).ToString();
            mPhysicsDefenseNew.text = (obj.GetPhysicalBaseDefence() - _heroDate.TrainingPhysicalDefence).ToString();
            mMagicDefenseNew.text   = (obj.GetMagicBaseDefence() - _heroDate.TrainingMagicDefence).ToString();
            mAccuracyNew.text       = obj.GetBaseHit().ToString();
            mEvaNew.text            = obj.GetBaseDodge().ToString();
            mCritNew.text           = obj.GetBaseCritical().ToString();
            mTenacityNew.text       = obj.GetBaseTenacity().ToString();
            mVelocityNew.text       = obj.GetBaseSpeed().ToString();
            int m_HeroStar = _hero.getQuality();
            int maxStar    = _hero.getMaxQuality();

            //星级品质界面控制
            for (int i = 0; i < 5; i++)
            {
                mStarListNew[i].SetActive(i + 1 <= m_HeroStar);
                mStarBGListNew[i].SetActive(i + 1 <= maxStar);
            }
            //for (int i = 0; i < mStarListNew.Count; i++)
            //{
            //    if (i < _hero.getQuality())
            //    {
            //        mStarListNew[i].SetActive(true);
            //    }
            //    else
            //    {
            //        mStarListNew[i].SetActive(false);
            //    }
            //}
            mSkillMaxNew.text = _hero.getSkillMaxLevel().ToString();
            Show3DModel(obj);
        }