private HeroInfo PrepareHeroInfo(PlayerInfo.SimpleHeroInfo simpInfo)
        {
            HeroEntity      heroEntity      = HeroDBModel.Instance.Get(simpInfo.HeroId);
            HeroLevelEntity heroLevelEntity = HeroLevelDBModel.Instance.GetList().Find(x => x.Level == simpInfo.HeroLevel);
            JobEntity       jobEntity       = JobDBModel.Instance.Get(heroEntity.Job);
            HeroStarEntity  heroStarEntity  = HeroStarDBModel.Instance.GetList().Find(x => x.Star == simpInfo.HeroStar);

            if (heroLevelEntity != null || heroLevelEntity != null || jobEntity != null || heroStarEntity != null)
            {
                HeroInfo info = new HeroInfo();
                info.RoleId       = simpInfo.RoleId;
                info.RoleNickName = heroEntity.Name;
                info.Level        = heroLevelEntity.Level;
                info.MaxHP        = (int)(heroLevelEntity.Hp * heroEntity.Hp * jobEntity.Hp * heroStarEntity.Hp);
                info.CurrentHP    = info.MaxHP;
                info.PhyAtk       = (int)(heroLevelEntity.PhyAtk * heroEntity.PhyAtk * jobEntity.PhyAtk * heroStarEntity.PhyAtk);
                info.MgicAtk      = (int)(heroLevelEntity.MgicAtk * heroEntity.MgicAtk * jobEntity.MgicAtk * heroStarEntity.MgicAtk);
                info.Cri          = (int)(heroLevelEntity.Cri * heroEntity.Cri * jobEntity.Cri * heroStarEntity.Cri);
                info.CriValue     = (int)(heroLevelEntity.CriValue * heroEntity.CriValue * jobEntity.CriValue * heroStarEntity.CriValue);
                info.PhyDef       = (int)(heroLevelEntity.PhyDef * heroEntity.PhyDef * jobEntity.PhyDef * heroStarEntity.PhyDef);
                info.MgicDef      = (int)((heroLevelEntity.MgicDef * heroEntity.MgicDef * jobEntity.MgicDef * heroStarEntity.MgicDef));
                info.HeroID       = heroEntity.Id;
                info.JobID        = jobEntity.Id;
                info.HeroStar     = simpInfo.HeroStar;
                for (int j = 0; j < simpInfo.SkillInfoList.Count; j++)
                {
                    RoleInfoSkill skillInfo = new RoleInfoSkill();
                    skillInfo.SkillId    = simpInfo.SkillInfoList[j].SkillId;
                    skillInfo.SKillLevel = simpInfo.SkillInfoList[j].SkillLevel;
                    info.SkillList.Add(skillInfo);
                }
                return(info);
            }
            return(null);
        }
        private void OnClickHeroUpgradeStarCallBack(object[] p)
        {
            long     roleId   = (long)p[0];
            HeroInfo heroInfo = Global.HeroInfoList.Find(x => x.RoleId == roleId);

            if (heroInfo == null)
            {
                Debug.LogError("错误:没有英雄信息");
                return;
            }
            if (heroInfo.HeroStar >= 5)
            {
                //提示
                //TODO
                Debug.Log("此英雄已经是最高星级");
                return;
            }
            HeroStarEntity heroStarEntity = HeroStarDBModel.Instance.GetList().Find((x) => x.Star == heroInfo.HeroStar);

            if (heroStarEntity == null)
            {
                Debug.LogError("错误:找不到英雄星级实体");
                return;
            }
            if (SimulatedDatabase.Instance.GetDebris() >= heroStarEntity.NeedHeroDebris)
            {
                SimulatedDatabase.Instance.UpgradeHeroStart(roleId);
                SimulatedDatabase.Instance.ReduceDebris(heroStarEntity.NeedHeroDebris);
                DataTransfer data = GetHeroInfoData(roleId);
                if (data != null)
                {
                    m_HeroInfoView.RefreshAfterUpgradeStar(data);
                }
            }
            else
            {
                //提示
                //TODO
                Debug.Log("英雄残魂不够");
            }
        }
        private DataTransfer GetHeroInfoData(long roldID)
        {
            long       roleId = roldID;
            GameObject go     = UIViewUtil.Instance.OpenWindow(UIViewType.HeroInfoView);

            m_HeroInfoView = go.GetComponent <UIHeroInfoView>();
            if (m_HeroInfoView == null)
            {
                Debug.LogError("错误:没有这个界面");
                return(null);
            }
            HeroInfo heroInfo = Global.HeroInfoList.Find(x => x.RoleId == roleId);

            if (heroInfo == null)
            {
                Debug.LogError("错误:没有英雄信息");
                return(null);
            }
            HeroEntity heroEntity = HeroDBModel.Instance.Get(heroInfo.HeroID);

            if (heroEntity == null)
            {
                Debug.LogError("错误:找不到英雄实体");
                return(null);
            }
            string heroName    = heroInfo.RoleNickName;
            int    heroStar    = heroInfo.HeroStar;
            int    heroQuality = heroEntity.Quality;
            int    heroLevel   = SimulatedDatabase.Instance.GetLevel();
            int    hp          = heroInfo.MaxHP;
            int    mgicAtk     = heroInfo.MgicAtk;
            int    phyAtk      = heroInfo.PhyAtk;
            int    cri         = heroInfo.Cri;
            float  criValue    = heroInfo.CriValue;
            int    phyDef      = heroInfo.PhyDef;
            int    mgicDef     = heroInfo.MgicDef;

            DataTransfer data = new DataTransfer();

            data.SetData(ConstDefine.UI_HeroInfo_RoleId, roleId);
            data.SetData(ConstDefine.UI_HeroInfo_HeroName, heroName);
            data.SetData(ConstDefine.UI_HeroInfo_HeroStar, heroStar);
            data.SetData(ConstDefine.UI_HeroInfo_HeroQuality, heroQuality);
            data.SetData(ConstDefine.UI_HeroInfo_HeroLevel, heroLevel);

            data.SetData(ConstDefine.UI_HeroInfo_HeroHp, hp);
            data.SetData(ConstDefine.UI_HeroInfo_MgicAtk, mgicAtk);
            data.SetData(ConstDefine.UI_HeroInfo_PhyAtk, phyAtk);
            data.SetData(ConstDefine.UI_HeroInfo_Cri, cri);
            data.SetData(ConstDefine.UI_HeroInfo_CriValue, criValue);
            data.SetData(ConstDefine.UI_HeroInfo_PhyDef, phyDef);
            data.SetData(ConstDefine.UI_HeroInfo_MgicDef, mgicDef);

            List <DataTransfer> skillDatas = new List <DataTransfer>();

            for (int i = 0; i < heroInfo.SkillList.Count; i++)
            {
                DataTransfer skillData   = new DataTransfer();
                SkillEntity  skillEntity = SkillDBModel.Instance.Get(heroInfo.SkillList[i].SkillId);
                skillData.SetData(ConstDefine.UI_HeroInfo_SkillName, skillEntity.SkillName);
                string skillIcno = Global.Instance.GetSkillIconByRanggeAndType(skillEntity.AttackRange, skillEntity.AttackArea);
                skillData.SetData(ConstDefine.UI_HeroInfo_SkillIcon, skillIcno);
                skillData.SetData(ConstDefine.UI_HeroInfo_SkillDesc, skillEntity.SkillDesc);
                skillDatas.Add(skillData);
            }
            data.SetData(ConstDefine.UI_HeroInfo_SkillContent, skillDatas);

            HeroStarEntity heroStarEntity = HeroStarDBModel.Instance.GetList().Find((x) => x.Star == heroStar);

            data.SetData(ConstDefine.UI_HeroInfo_NeedDebris, heroStarEntity.NeedHeroDebris);
            data.SetData(ConstDefine.UI_HeroInfo_OwnedDebris, SimulatedDatabase.Instance.GetDebris());
            return(data);
        }