/// <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); }
public HeroBattleChoiceData() { selfInfo = new SidePlayerInfoData(); otherInfo = new SidePlayerInfoData(); selfChoices = new List <HeroBattleChoiceCellData>(); otherChoices = new List <HeroBattleChoiceCellData>(); selfBans = new List <HeroBattleChoiceCellData>(); otherBans = new List <HeroBattleChoiceCellData>(); dicHeroChoiceData = new Dictionary <Hotfix_LT.Data.eRoleAttr, List <HeroBattleChoiceCellData> >(); dicHeroChoiceData.Add(Hotfix_LT.Data.eRoleAttr.Shui, new List <HeroBattleChoiceCellData>()); dicHeroChoiceData.Add(Hotfix_LT.Data.eRoleAttr.Huo, new List <HeroBattleChoiceCellData>()); dicHeroChoiceData.Add(Hotfix_LT.Data.eRoleAttr.Feng, new List <HeroBattleChoiceCellData>()); InitAllHero(); }
/// <summary> /// 设置玩家信息 /// </summary> /// <param name="selfInfo">我的信息</param> /// <param name="otherInfo">对手的信息</param> private void SetPlayerInfo(SidePlayerInfoData selfInfo, SidePlayerInfoData otherInfo) { LTUIUtil.SetText(selfNameLabel, selfInfo.name); LTUIUtil.SetText(OtherNameLabel, otherInfo.name); m_LevelInfo[0].F_SetInfo(selfInfo); m_LevelInfo[1].F_SetInfo(otherInfo); // LTUIUtil.SetText(selfLevelLabel, BalanceResourceUtil.GetUserLevel().ToString() /*data.selfInfo.level.ToString()*/); LTUIUtil.SetText(otherLevelLabel, otherInfo.level.ToString()); selfHeadIconSpt.spriteName = LTMainHudManager.Instance.UserHeadIcon; selfFrameIconSpt.spriteName = LTMainHudManager.Instance.UserLeaderHeadFrame.iconId; otherHeadIconSpt.spriteName = otherInfo.portrait; otherFrameIconSpt.spriteName = otherInfo.frame; }
/// <summary> /// 设置信息 /// </summary> /// <param name="data">数据</param> public void F_SetInfo(SidePlayerInfoData data) { string levelName = ""; //换算当前的段位 for (int i = 0; i < GameStringValue.Ladder_Stage_Names.Length; i++) { int currentNeed = LadderManager.Instance.Config.GetStageNeedScore(GameStringValue.Ladder_Stage_Names[i]); if (data.score < currentNeed) { break; } else { levelName = GameStringValue.Ladder_Stage_Names[i]; } } //段位 m_LevelIcon.spriteName = LadderController.GetStageSpriteName(levelName); levelName = LadderController.GetStageCharacterName(levelName); LTUIUtil.SetText(m_Level, levelName); }
/// <summary> /// 设置队伍 /// </summary> /// <param name="team">队伍数据</param> /// <param name="playerInfo">玩家信息</param> /// <param name="bans">禁用的数据</param> /// <param name="isSelfTeam">是否为我方回合</param> public void F_SetTeam(List <HeroBattleChoiceCellData> team, SidePlayerInfoData playerInfo, List <HeroBattleChoiceCellData> bans) { if (m_TeamCard != null) { for (int i = 0; i < m_TeamCard.Length; i++) { if (team != null && i < team.Count) { bool needSetFx = m_SetTotal != team.Count ? i == team.Count - 1 : false; m_TeamCard[i].F_SetCardInfo(team[i], playerInfo, bans != null && bans.Find(p => p.heroTplID == team[i].heroTplID) != null, needSetFx); } else { m_TeamCard[i].F_SetCardInfo(null, playerInfo, false, false); } } } if (team != null) { m_SetTotal = team.Count; } }