Beispiel #1
0
        /// <summary>
        /// 设置伙伴信息
        /// </summary>
        /// <param name="partnerData">伙伴数据</param>
        public void F_SetCardInfo(HeroBattleChoiceCellData partnerData)
        {
            m_Data = partnerData;
            bool isNull = partnerData == null;

            m_SelfObj.SetActive(!isNull);
            if (!isNull)
            {
                //获取指定的伙伴数据
                LTPartnerData data = LTPartnerDataManager.Instance.GetGeneralPartnerList().Find(p => p.HeroStat.id == partnerData.heroTplID);
                if (data != null)
                {
                    m_Card.Fill(data);
                    ////不要设置死亡情况
                    m_Card.DeathSprite.gameObject.SetActive(false);
                }
                else
                {
                    EB.Debug.LogError("为什么相应的partnerData.heroTplID:{0},没有相应的伙伴数据?", partnerData.heroTplID);
                }
                //是否选中
                m_SelectState.SetActive(partnerData.isUsed);
                //特效是否显示
                bool fxVisible = !partnerData.isUsed;
                if (fxVisible && data.HeroInfo.role_grade != (int)PartnerGrade.SSR)
                {
                    fxVisible = false;
                }
                for (int i = 0; i < m_Card.LevelSprite.transform.childCount; i++)
                {
                    m_Card.LevelSprite.transform.GetChild(i).gameObject.SetActive(fxVisible);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 初始化所有英雄数据
        /// </summary>
        public void InitAllHero()
        {
            foreach (var list in dicHeroChoiceData)
            {
                list.Value.Clear();
            }
            //筛选出自己拥有的英雄
            List <LTPartnerData> generalPL = LTPartnerDataManager.Instance.GetOwnPartnerList();

            //直接使用自己拥有的伙伴列表
            //Dictionary<int, Hotfix_LT.Data.HeroInfoTemplate> AllHBHero = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetAllHBHeroInfoTemplate();
            for (int i = 0; i < generalPL.Count; i++)
            {
                Data.HeroInfoTemplate    hero          = generalPL[i].HeroInfo;
                HeroBattleChoiceCellData cellData      = new HeroBattleChoiceCellData(hero.id + 1, hero, 0);
                LTPartnerData            ltPartnerData = generalPL[i];
                if (dicHeroChoiceData.ContainsKey(cellData.type) && ltPartnerData != null)
                {
                    cellData.isUnLock      = true;
                    cellData.level         = ltPartnerData.Level;
                    cellData.peak          = ltPartnerData.AllRoundLevel;
                    cellData.artifactLevel = ltPartnerData.ArtifactLevel;
                    cellData.star          = ltPartnerData.Star;
                    cellData.skin          = ltPartnerData.CurSkin;
                    cellData.isAwake       = ltPartnerData.IsAwaken;
                    cellData.modelName     = ltPartnerData.HeroInfo.model_name;
                    cellData.iconName      = ltPartnerData.HeroInfo.icon;
                    dicHeroChoiceData[cellData.type].Add(cellData);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// 每回合选英雄前 收到数据添加使用英雄后调用
        /// </summary>
        public void RefreshChoiceState()
        {
            choiceData.choiceSuitIndex = 0; //默认选择英雄第一套

            if (choiceData.openUid == choiceData.selfInfo.uid)
            {
                if (choiceData.choiceType == 0)
                {
                    choiceData.choiceType = Hotfix_LT.Data.eRoleAttr.Shui;
                }
                //HeroBattleChoiceCellData choice = GetFirstChoiceHero(choiceData.choiceType);

                //if (choice == null)
                {
                    choiceData.choiceHeroCellData = null;
                    choiceData.choiceHeroTplID    = -1;
                }
                //else
                //{
                //    choiceData.choiceHeroCellData = choice;
                //    choiceData.choiceHeroTplID = choice.heroTplID;
                //}
            }
            else
            {
                //回合结束仍然需要展示使用的模型
                HeroBattleChoiceCellData lastUsed = null;
                if (choiceData.selfChoices.Count > 0) //优先显示最近选用的
                {
                    lastUsed = choiceData.selfChoices[choiceData.selfChoices.Count - 1];
                }
                else if (choiceData.selfBans.Count > 0) //次级显示最近禁用的
                {
                    lastUsed = choiceData.selfBans[choiceData.selfBans.Count - 1];
                }

                if (lastUsed == null)
                {
                    choiceData.choiceHeroCellData = null;
                    choiceData.choiceHeroTplID    = -1;
                }
                else
                {
                    choiceData.choiceHeroCellData = lastUsed;
                    choiceData.choiceHeroTplID    = lastUsed.heroTplID;
                }
            }

            choiceData.Refresh();

            if (LTHeroBattleEvent.NotifyRefreshChoiceState != null)
            {
                LTHeroBattleEvent.NotifyRefreshChoiceState(choiceData);
            }
        }
Beispiel #4
0
 private bool HeroInTeam(int herotpid)
 {
     for (int i = 0; i < m_TeamCard.Length; i++)
     {
         HeroBattleChoiceCellData partnerData = m_TeamCard[i].F_GetCurrentPartnerData();
         if (partnerData != null && LTHeroBattleModel.GetInstance().choiceData != null && LTHeroBattleModel.GetInstance().choiceData.choiceState != 0 && herotpid == partnerData.heroTplID)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #5
0
        /// <summary>
        /// 设置伙伴信息
        /// </summary>
        /// <param name="choiceData">伙伴数据</param>
        /// <param name="playerInfo">玩家信息</param>
        /// <param name="isBan">是否被禁用</param>
        /// <param name="isNeedSetFx">是否需要设置特效</param>
        public void F_SetCardInfo(HeroBattleChoiceCellData choiceData, SidePlayerInfoData playerInfo, bool isBan, bool isNeedSetFx)
        {
            m_ChoiceData = choiceData;
            LTPartnerData data = null;

            m_LockState.CustomSetActive(isBan);
            m_SelectLockState.CustomSetActive(false);
            if (choiceData != null)
            {
                data          = new LTPartnerData();
                data.StatId   = 0;
                data.InfoId   = choiceData.heroTplID;
                data.HeroStat = null;
                int characterId = choiceData.heroTplID;
                //判断当前的数据是否为机器人
                if (playerInfo.uid == 0)
                {
                    Hotfix_LT.Data.MonsterInfoTemplate monster = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMonsterInfo(choiceData.heroTplID);
                    if (monster != null)
                    {
                        characterId = int.Parse(monster.character_id);
                    }
                    else
                    {
                        EB.Debug.LogError("为什么输入的choiceData.heroTplID:{0},没有相应的怪物数据", choiceData.heroTplID);
                    }
                }
                else
                {
                    characterId -= 1;
                }
                //模型皮肤
                data.HeroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(characterId, choiceData.skin);
                //不能为零
                data.mHeroId = 1;
                //修改这里来调整UI的表现
                data.IsHire            = true;
                data.HireHeroId        = 1;
                data.HireLevel         = choiceData.level;
                data.HireAllRoundLevel = choiceData.peak;
                data.HireArtifactLevel = choiceData.artifactLevel;
                data.HireUpGradeId     = choiceData.upGrade;
                data.HireStar          = choiceData.star;
                //觉醒
                data.HireAwakeLevel = choiceData.isAwake;
                //设置卡片时的特效
                if (isNeedSetFx)
                {
                    EB.Coroutines.Run(SetCardFx());
                }
            }
            m_Card.Fill(data);
        }
Beispiel #6
0
        public void SetMatchBase(LTHeroBattleAPI.HeroBattleMatchBase data)
        {
            matchData.isGetReward = data.IsGetReward;
            matchData.victoryNum  = data.VictoryCount;
            matchData.defeatNum   = data.DefeatCount;
            matchData.defeatMax   = (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("heroBattleDefeatMaxCount");
            matchData.victoryMax  = (int)Hotfix_LT.Data.NewGameConfigTemplateManager.Instance.GetGameConfigValue("heroBattleVictoryMaxCount");
            matchData.listLimitFreeHero.Clear();
            matchData.listLimitFreeCell.Clear();
            matchData.listBaseHero.Clear();
            matchData.listBaseHeroCell.Clear();
            for (int i = 0; i < data.FreeHeros.Count; i++)
            {
                int tplID = int.Parse((string)data.FreeHeros[i]);
                matchData.listLimitFreeHero.Add(tplID);
                Hotfix_LT.Data.HeroStatTemplate heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(tplID);
                if (heroStat != null)
                {
                    Hotfix_LT.Data.HeroInfoTemplate heroInfo   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroStat.character_id);
                    HeroBattleChoiceCellData        choiceCell = new HeroBattleChoiceCellData(tplID, heroInfo, 0);
                    matchData.listLimitFreeCell.Add(choiceCell);
                }
                else
                {
                    EB.Debug.LogError("SetMatchBase.FreeHeros:heroStat is null tplID={0}", tplID);
                }
            }

            for (int i = 0; i < data.BaseHeroes.Count; i++)
            {
                int tplID = int.Parse((string)data.BaseHeroes[i]);
                matchData.listBaseHero.Add(tplID);
                Hotfix_LT.Data.HeroStatTemplate heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(tplID);
                if (heroStat != null)
                {
                    Hotfix_LT.Data.HeroInfoTemplate heroInfo   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroStat.character_id);
                    HeroBattleChoiceCellData        choiceCell = new HeroBattleChoiceCellData(tplID, heroInfo, 0);
                    matchData.listBaseHeroCell.Add(choiceCell);
                }
                else
                {
                    EB.Debug.LogError("SetMatchBase.BaseHeroes:heroStat is null tplID={0}", tplID);
                }
            }

            choiceData.AddHeroPool();

            // if (LTHeroBattleEvent.NotifyRefreshMatchData != null)
            // {
            //     LTHeroBattleEvent.NotifyRefreshMatchData(matchData);
            // }
        }
Beispiel #7
0
 /// <summary>
 /// 通过英雄伙伴id获取物怪的信息
 /// </summary>
 /// <param name="heroTplID">英雄伙伴id</param>
 /// <returns></returns>
 private HeroBattleChoiceCellData GetMonsterInfo(int heroTplID, int curSkin)
 {
     Hotfix_LT.Data.MonsterInfoTemplate heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetMonsterInfo(heroTplID);
     if (heroStat != null)
     {
         Hotfix_LT.Data.HeroInfoTemplate heroInfo   = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroStat.character_id, curSkin);
         HeroBattleChoiceCellData        choiceCell = new HeroBattleChoiceCellData(heroTplID, heroInfo, 0);
         return(choiceCell);
     }
     else
     {
         EB.Debug.LogError("SetMatchBase:heroStat is null tplID={0}", heroTplID);
         return(null);
     }
 }
Beispiel #8
0
        static public List <HeroBattleChoiceCellData> GetHeroListByAttr(Hotfix_LT.Data.eRoleAttr type)
        {
            List <HeroBattleChoiceCellData> listCellData = new List <HeroBattleChoiceCellData>();

            Hotfix_LT.Data.HeroStatTemplate[] allPartnerCollection = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStats();
            for (var i = 0; i < allPartnerCollection.Length; i++)
            {
                var heroTpl = allPartnerCollection[i];
                Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroTpl.character_id);
                if (heroInfo.char_type == type && heroInfo.isShowInClash)
                {
                    HeroBattleChoiceCellData choiceCell = new HeroBattleChoiceCellData(heroTpl.id, heroInfo, 0);
                    listCellData.Add(choiceCell);
                }
            }
            return(listCellData);
        }
Beispiel #9
0
        /// <summary>
        /// 点击阵型里的伙伴
        /// </summary>
        /// <param name="cardItem">点击的卡片item</param>
        private void OnClickPartnerItem(LTPVPTeamCardInfo cardItem)
        {
            HeroBattleChoiceCellData partnerData = cardItem.F_GetCurrentPartnerData();

            if (LTHeroBattleModel.GetInstance().choiceData.choiceState == 0 &&
                LTHeroBattleModel.GetInstance().choiceData.openUid == LTHeroBattleModel.GetInstance().choiceData.selfInfo.uid &&
                !m_IsSelfTeam &&
                partnerData != null)
            {
                //通知选中的人
                FusionAudio.PostEvent("UI/General/ButtonClick", true);
                LTHeroBattleEvent.ChoiceHero(partnerData.heroTplID);
                //
                for (int i = 0; i < m_TeamCard.Length; i++)
                {
                    m_TeamCard[i].F_SetLockState(m_TeamCard[i] == cardItem);
                }
            }
        }
Beispiel #10
0
        public void SetChoiceHero(int heroTplID)
        {
            choiceData.choiceHeroTplID = heroTplID;
            HeroBattleChoiceCellData data = null;

            //禁用情况的判断
            if (LTHeroBattleModel.GetInstance().choiceData.choiceState == 0 && LTHeroBattleModel.GetInstance().choiceData.otherInfo.uid == 0)
            {
                data = GetMonsterInfo(heroTplID, 0);
            }
            else if (LTHeroBattleModel.GetInstance().choiceData.choiceState == 0 && LTHeroBattleModel.GetInstance().choiceData.otherInfo.uid != 0)
            {
                List <HeroBattleChoiceCellData> templist = LTHeroBattleModel.GetInstance().choiceData.otherChoices;
                for (int i = 0; i < templist.Count; i++)
                {
                    if (templist[i].heroTplID == heroTplID)
                    {
                        data = templist[i];
                        break;
                    }
                }
                if (data == null)
                {
                    data = GetHeroCellCommon(heroTplID);
                }
            }
            else
            {
                data = GetHeroCellCommon(heroTplID);
            }
            choiceData.choiceHeroCellData = data;

            // if (LTHeroBattleEvent.NotifyChangeChoiceHeroTplID != null)
            // {
            //     LTHeroBattleEvent.NotifyChangeChoiceHeroTplID(heroTplID);
            // }
            if (LTHeroBattleEvent.NotifyChangeChoiceHero != null)
            {
                LTHeroBattleEvent.NotifyChangeChoiceHero(choiceData.choiceHeroCellData);
            }
        }
Beispiel #11
0
        private HeroBattleChoiceCellData GetHeroCell(int heroTplID)
        {
            HeroBattleChoiceCellData choiceCell = null;

            foreach (var v in choiceData.dicHeroChoiceData)
            {
                for (int i = 0; i < v.Value.Count; i++)
                {
                    if (v.Value[i].heroTplID == heroTplID)
                    {
                        choiceCell = v.Value[i];
                        break;
                    }
                }
                if (choiceCell != null)
                {
                    break;
                }
            }
            return(choiceCell);
        }
Beispiel #12
0
        /// <summary>
        /// 托管情况下获取英雄
        /// </summary>
        /// <returns></returns>
        public int GetAutoSelectHero()
        {
            int temp = 0;

            if (m_IsSelfTeam)
            {
                List <LTPartnerData> partnerList = LTPartnerDataManager.Instance.GetOwnPartnerListSortByPowerData();
                for (int i = 0; i < partnerList.Count; ++i)
                {
                    if (HeroInTeam(partnerList[i].HeroStat.id))
                    {
                        continue;
                    }
                    else
                    {
                        temp = partnerList[i].HeroStat.id;
                        break;
                    }
                }
            }
            else
            {
                int level = 0;
                int star  = 0;
                for (int i = 0; i < m_TeamCard.Length; i++)
                {
                    HeroBattleChoiceCellData partnerData = m_TeamCard[i].F_GetCurrentPartnerData();
                    if (partnerData != null && partnerData.heroTplID != 0)
                    {
                        if (partnerData.level > level || partnerData.level == level && partnerData.star > star)
                        {
                            level = partnerData.level;
                            star  = partnerData.star;
                            temp  = partnerData.heroTplID;
                        }
                    }
                }
            }
            return(temp);
        }
Beispiel #13
0
 private HeroBattleChoiceCellData GetHeroCellCommon(int heroTplID)
 {
     Hotfix_LT.Data.HeroStatTemplate heroStat = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroStat(heroTplID);
     if (heroStat != null)
     {
         Hotfix_LT.Data.HeroInfoTemplate heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(heroStat.character_id);
         LTPartnerData            data            = LTPartnerDataManager.Instance.GetPartnerByStatId(heroTplID);
         HeroBattleChoiceCellData choiceCell      = new HeroBattleChoiceCellData(heroTplID, heroInfo, 0);
         int curskin = 0;
         if (data != null)
         {
             curskin = data.CurSkin;
             choiceCell.modelName = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(data.InfoId, curskin).model_name;
         }
         return(choiceCell);
     }
     else
     {
         EB.Debug.LogError("SetMatchBase:heroStat is null tplID={0}", heroTplID);
         return(null);
     }
 }
Beispiel #14
0
        /// <summary>
        /// 设置选中数据
        /// </summary>
        /// <param name="data">数据</param>
        public void SetChoiceData(LTHeroBattleAPI.HeroBattleData data)
        {
            /*
             * EB.Debug.LogError("[" + Time.frameCount + "]服务器已经下发数据:当前的操作行为:Status:" + data.Status
             + ",是否为玩家:" + (data.OpenUid == LoginManager.Instance.LocalUserId.Value));
             */
            choiceData.choiceState = data.Status.Equals("banhero") ? 0 : data.Status.Equals("selecthero") ? 1 : 2;
            choiceData.openUid     = data.OpenUid;
            choiceData.lessTime    = EB.Time.After(data.NextTS);

            for (int i = 0; i < data.Sides.Length; i++)
            {
                if (data.Sides[i].Uid == LoginManager.Instance.LocalUserId.Value) //若是玩家自己
                {
                    choiceData.selfInfo.name     = data.Sides[i].Name;
                    choiceData.selfInfo.uid      = data.Sides[i].Uid;
                    choiceData.selfInfo.level    = data.Sides[i].Level;
                    choiceData.selfInfo.portrait = data.Sides[i].Portrait;
                    choiceData.selfInfo.frame    = data.Sides[i].Frame;
                    choiceData.selfInfo.isSelf   = true;
                    choiceData.selfBans.Clear();
                    for (int j = 0; j < data.Sides[i].BandTplIds.Length; j++)
                    {
                        int tplID = 0;
                        if (!int.TryParse(data.Sides[i].BandTplIds[j], out tplID))
                        {
                            continue;
                        }

                        HeroBattleChoiceCellData cell = choiceData.selfChoices.Find(p => p.heroTplID == tplID);
                        if (cell != null)
                        {
                            choiceData.selfBans.Add(cell);
                        }
                        else
                        {
                            EB.Debug.LogError("choiceData.selfBans cell is null tplID={0}", tplID);
                        }
                    }
                    choiceData.selfChoices.Clear();
                    for (int j = 0; j < data.Sides[i].SelectHeroIds.Count; j++)
                    {
                        if (data.Sides[i].SelectHeroIds[j] != null)
                        {
                            int    id                     = EB.Dot.Integer("id", data.Sides[i].SelectHeroIds[j], 0);
                            int    tplID                  = EB.Dot.Integer("tplId", data.Sides[i].SelectHeroIds[j], 0);
                            int    star                   = EB.Dot.Integer("star", data.Sides[i].SelectHeroIds[j], 0);
                            int    level                  = EB.Dot.Integer("level", data.Sides[i].SelectHeroIds[j], 0);
                            int    peak                   = EB.Dot.Integer("proficiency.1.1", data.Sides[i].SelectHeroIds[j], 0);
                            int    upgrade                = EB.Dot.Integer("upgrade", data.Sides[i].SelectHeroIds[j], 0);
                            int    charType               = EB.Dot.Integer("charType", data.Sides[i].SelectHeroIds[j], -1);
                            string roleGrade              = EB.Dot.String("roleGrade", data.Sides[i].SelectHeroIds[j], "");
                            int    awakenLevel            = EB.Dot.Integer("awaken", data.Sides[i].SelectHeroIds[j], 0);
                            int    skin                   = EB.Dot.Integer("skin", data.Sides[i].SelectHeroIds[j], 0);
                            int    artifactLevel          = EB.Dot.Integer("artifact_equip.enhancement_level", data.Sides[i].SelectHeroIds[j], -1);
                            HeroBattleChoiceCellData cell = GetHeroCell(tplID);
                            if (cell != null)
                            {
                                cell.star          = star;
                                cell.type          = (Hotfix_LT.Data.eRoleAttr)charType;
                                cell.upGrade       = upgrade;
                                cell.level         = level;
                                cell.peak          = peak;
                                cell.artifactLevel = artifactLevel;
                                cell.skin          = skin;
                                cell.modelName     = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(tplID - 1, skin).model_name;
                                cell.isAwake       = awakenLevel;
                                choiceData.selfChoices.Add(cell);
                            }
                            else
                            {
                                EB.Debug.LogError("choiceData.SelectHero cell is null tplID={0}", tplID);
                            }
                        }
                    }
                }
                else
                {
                    choiceData.otherInfo.name = data.Sides[i].Name;
                    choiceData.otherInfo.uid  = data.Sides[i].Uid;
                    //机器人情况下,强行修改和我的分段一样
                    //if (data.Sides[i].Uid == 0)
                    //{
                    //    choiceData.otherInfo.level = choiceData.selfInfo.level;
                    //    choiceData.otherInfo.score = LadderManager.Instance.Info.Point;
                    //}
                    //else
                    {
                        choiceData.otherInfo.level = data.Sides[i].Level;
                    }

                    choiceData.otherInfo.portrait = data.Sides[i].Portrait;
                    choiceData.otherInfo.frame    = data.Sides[i].Frame;
                    choiceData.otherInfo.isSelf   = false;
                    choiceData.otherBans.Clear();
                    for (int j = 0; j < data.Sides[i].BandTplIds.Length; j++)
                    {
                        int tplID = 0;
                        if (!int.TryParse(data.Sides[i].BandTplIds[j], out tplID))
                        {
                            continue;
                        }
                        HeroBattleChoiceCellData cell = choiceData.otherChoices.Find(p => p.heroTplID == tplID);
                        if (cell != null)
                        {
                            choiceData.otherBans.Add(cell);
                        }
                        else
                        {
                            EB.Debug.LogError("choiceData.otherBans cell is null tplID={0}", tplID);
                        }
                    }
                    choiceData.otherChoices.Clear();
                    for (int j = 0; j < data.Sides[i].SelectHeroIds.Count; j++)
                    {
                        if (data.Sides[i].SelectHeroIds[j] != null)
                        {
                            int    id                     = EB.Dot.Integer("id", data.Sides[i].SelectHeroIds[j], 0);
                            int    tplID                  = EB.Dot.Integer("tplId", data.Sides[i].SelectHeroIds[j], 0);
                            int    star                   = EB.Dot.Integer("star", data.Sides[i].SelectHeroIds[j], 0);
                            int    level                  = EB.Dot.Integer("level", data.Sides[i].SelectHeroIds[j], 0);
                            int    peak                   = EB.Dot.Integer("proficiency.1.1", data.Sides[i].SelectHeroIds[j], 0);
                            int    upgrade                = EB.Dot.Integer("upgrade", data.Sides[i].SelectHeroIds[j], 0);
                            int    charType               = EB.Dot.Integer("charType", data.Sides[i].SelectHeroIds[j], -1);
                            string roleGrade              = EB.Dot.String("roleGrade", data.Sides[i].SelectHeroIds[j], "");
                            int    awakenLevel            = EB.Dot.Integer("awaken", data.Sides[i].SelectHeroIds[j], 0);
                            int    skin                   = EB.Dot.Integer("skin", data.Sides[i].SelectHeroIds[j], 0);
                            HeroBattleChoiceCellData cell = null;
                            //判断当前对手是否为机器人
                            if (data.Sides[i].Uid == 0)
                            {
                                cell = GetMonsterInfo(tplID, skin);
                            }
                            else
                            {
                                cell = GetHeroCellCommon(tplID);
                            }

                            if (cell != null)
                            {
                                cell.star    = star;
                                cell.type    = (Hotfix_LT.Data.eRoleAttr)charType;
                                cell.upGrade = upgrade;
                                cell.level   = level;
                                cell.peak    = peak;
                                cell.skin    = skin;
                                if (data.Sides[i].Uid != 0)
                                {
                                    cell.modelName = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(cell.heroTplID - 1, skin).model_name;
                                }
                                cell.isAwake = awakenLevel;
                                choiceData.otherChoices.Add(cell);
                            }
                            else
                            {
                                EB.Debug.LogError("choiceData.SelectHero cell is null tplID={0}", tplID);
                            }
                        }
                    }
                }
            }
            if (data.Status.Equals("battle"))
            {
                //筛选出自己拥有的英雄
                List <LTPartnerData> generalPL = LTPartnerDataManager.Instance.GetOwnPartnerList();
                //开战前存储这次的上场的英雄,好给结算界面调用
                string    teamName     = FormationUtil.GetCurrentTeamName(eBattleType.LadderBattle);
                string    teamDataPath = SmallPartnerPacketRule.USER_TEAM + "." + teamName + ".team_info";
                ArrayList heroIds      = Johny.ArrayListPool.Claim();
                for (int i = 0; i < choiceData.selfChoices.Count; i++)
                {
                    if (choiceData.selfBans.Find(p => p.heroTplID == choiceData.selfChoices[i].heroTplID) == null)
                    {
                        LTPartnerData ltParnerData = generalPL.Find(p => p.HeroStat.id == choiceData.selfChoices[i].heroTplID);
                        heroIds.Add(ltParnerData.HeroId);
                    }
                }
                DataLookupsCache.Instance.CacheData(teamDataPath, heroIds);

                //
                if (LTHeroBattleEvent.NotifyHeroBattleHudFinish != null)
                {
                    LTHeroBattleEvent.NotifyHeroBattleHudFinish();
                }
            }
            else if (choiceData.selfChoices.Count > 0 || choiceData.otherChoices.Count > 0) //当有一边选人后延迟场景跳转 放置跳转前没有倒计时问题
            {
                if (LTHeroBattleEvent.NotifyHeroBattleDelayToScene != null)
                {
                    LTHeroBattleEvent.NotifyHeroBattleDelayToScene();
                }
            }

            RefreshChoiceState();
        }
Beispiel #15
0
        /// <summary>
        /// 设置英雄操作数据
        /// </summary>
        /// <param name="data">操作的数据</param>
        protected override void SetChoiceData(HeroBattleChoiceData data)
        {
            SetPlayerInfo(data.selfInfo, data.otherInfo);

            bool isSelfTurn = (data.openUid == data.selfInfo.uid);

            if (data.choiceState != 2)
            {
                turnGO.alpha      = (isSelfTurn) ? 1 : 0;
                otherTurnGO.alpha = (!isSelfTurn) ? 1 : 0;
                if (_vsLobby != null)
                {
                    _vsLobby.SetTurn(isSelfTurn);
                }
            }

            _choiceState = data.choiceState;

            //设置按钮内容
            m_ConfirmBtn.CustomSetActive(data.choiceState != 2 && isSelfTurn);
            string confirmStr = data.choiceState == 0 ? EB.Localizer.GetString("ID_uifont_in_LTHeroBattleMenu_Label (1)_4") : EB.Localizer.GetString("ID_DIALOG_BUTTON_OK");

            m_ConfirmLabel.text = confirmStr;

            switch (data.choiceState)
            {
            case 0:
                LTUIUtil.SetText(choiceStateTipsLabel, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleHudController_13617"));
                break;

            case 1:
                LTUIUtil.SetText(choiceStateTipsLabel, EB.Localizer.GetString("ID_codefont_in_LTHeroBattleHudController_14889"));
                break;

            case 2:     //非操作模式
                break;
            }

            if (data.selfChoices != null && data.selfChoices.Count == 6)
            {
                StartChangShowModel(data.selfChoices[data.selfChoices.Count - 1].modelName, data.selfChoices[data.selfChoices.Count - 1].heroName,
                                    LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[data.selfChoices[data.selfChoices.Count - 1].type]);
            }
            else
            {
                StartChangShowModel("", "", "");
            }

            if (data.otherChoices != null && data.otherChoices.Count > 0) //如果有已选用 优先显示最近选用的  ps 这是他人的 自己的由于机制不同 在LTHeroBattleModel处理
            {
                HeroBattleChoiceCellData otherLastChoiceCell = data.otherChoices[data.otherChoices.Count - 1];
                StartChangeOtherShowModel(otherLastChoiceCell.modelName, otherLastChoiceCell.heroName,
                                          LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[otherLastChoiceCell.type]);
            }
            else if (data.otherBans != null && data.otherBans.Count > 0) //如果没有已选用 优先显示最近禁用的
            {
                HeroBattleChoiceCellData otherLastChoiceCell = data.otherBans[data.otherBans.Count - 1];
                StartChangeOtherShowModel(otherLastChoiceCell.modelName, otherLastChoiceCell.heroName,
                                          LTPartnerConfig.LEVEL_SPRITE_NAME_DIC[otherLastChoiceCell.type]);
            }
            else //都没有久清空显示的模型
            {
                StartChangeOtherShowModel("", "", "");
            }

            //刷新显示剩余点数
            LTUIUtil.SetText(myPointLabel, data.lessPoint + "/10");
            LTUIUtil.SetText(otherPointLabel, data.otherLessPoint + "/10");
            myLeftPointBar.value    = data.lessPoint / 10f;
            otherLeftPointBar.value = data.otherLessPoint / 10f;
            //设置当前的阵容
            m_TeamPlane[0].F_SetTeam(data.selfChoices, data.selfInfo, data.selfBans);
            m_TeamPlane[1].F_SetTeam(data.otherChoices, data.otherInfo, data.otherBans);
            if (data.choiceState != 2)
            {
                StartChangeTurn(isSelfTurn, data.lessTime);
                StartShowTime(data.lessTime);
                //设置高亮队伍表示操作中
                m_TeamPlane[0].F_SetHeightLight((isSelfTurn && data.choiceState == 1) || (!isSelfTurn && data.choiceState == 0), data.selfChoices.Count, data.choiceState == 0);
                m_TeamPlane[1].F_SetHeightLight((!isSelfTurn && data.choiceState == 1) || (isSelfTurn && data.choiceState == 0), data.otherChoices.Count, data.choiceState == 0);
            }

            m_HeroBattleChoiceData = data;
            //
            SetPartnerPanel(data);
        }