/// 更新玩家对战信息 public void UpdatePlayersVsInfo(cmd_match_load_scene_playerinfo data) { // 如果找到这个元素就清空重新把元素加入进去 if (dicPlayersVsInfo.ContainsKey(data.idActor)) { return; } WarPlayerVsInfo warPersonVsInfo = new WarPlayerVsInfo(); warPersonVsInfo.uPdbid = data.idActor; warPersonVsInfo.nHeroID = data.nHeroID; warPersonVsInfo.nCamp = data.nCamp; warPersonVsInfo.nSex = data.cmdPlayerVsDetails.nSex; warPersonVsInfo.nHeroGameNum = data.cmdPlayerVsDetails.nHeroGameNum; warPersonVsInfo.fHeroWinRate = data.cmdPlayerVsDetails.fHeroWinRate; warPersonVsInfo.sRankDesc = data.cmdPlayerVsDetails.szGradeName; warPersonVsInfo.nCampIndex = data.nCampIndex; warPersonVsInfo.bComputer = data.nIsComputer > 0; warPersonVsInfo.szVocationName = data.szVocationName; warPersonVsInfo.nSelfCamp = data.nSelfCamp; dicPlayersVsInfo.Add(data.idActor, warPersonVsInfo); return; }
//添加玩家信息框 //AttachWarPlayerFrame(_nCurIndex,_nCampPlayerCount,_nCamp,_nHeroID,_strVocationName,_strPlayerName,_nSkill1ID,_nSkill2ID) public void AttachWarPlayerFrame(int _nIndex, cmd_match_load_scene_playerinfo _data) { if (dicPlayerFrameTable == null) { dicPlayerFrameTable = new System.Collections.Generic.Dictionary <uint, FPlayerFrameData>(); } //AttachWarPlayerFrame(_nCurIndex:int,_nCampPlayerCount:int,_nCamp:int,_nHeroID:int,_strVocationName:String,_strPlayerName:String,_nSkill1ID:int = 1,_nSkill2ID:int = 1) if (_data.nHeroID <= 0 || !Value.IsValueValid(vWarLoadingMgr)) { Trace.LogWarning("进入战场加载界面添加英雄信息框时,英雄ID不能为0"); return; } bool isComputer = _data.nIsComputer == 1 ? true:false; if (vWarLoadingMgr.Invoke("AttachWarPlayerFrame", _nIndex, _data.nCampPlayerCount, _data.nCamp, _data.nHeroID, _data.szVocationName, _data.szPlayerName, _data.nSupportSkill[0], _data.nSupportSkill[1], isComputer) == null) { Trace.LogError("error call AttachWarPlayerFrame failed"); return; } if (!dicPlayerFrameTable.ContainsKey(_data.idActor)) { dicPlayerFrameTable.Add(_data.idActor, new FPlayerFrameData(_nIndex, _data.nCampPlayerCount, _data.nCamp)); } }
public void SetItemData(cmd_match_load_scene_playerinfo data) { int nSkinIconID = 0; SkinInfoScheme skinConfig = new SkinInfoScheme(); if (GameLogicAPI.GetHeroSkinInfo(data.nSkinID, ref skinConfig)) { nSkinIconID = skinConfig.nSkinIconID; } Sprite skinSprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_LOADINGWARVIEW, nSkinIconID, 1, data.nHeroID); if (skinSprite == null) { skinSprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_HeadPortrait, WndID.WND_ID_LOADINGWARVIEW, 1, 1, data.nHeroID); } HeroIcon.sprite = skinSprite; SSchemeHeroXPskillConfig xpConfig = HeroXPskillConfig.Instance.GetHeroXPskillConfig(data.nHeroID, data.nXPSkillID); if (xpConfig != null) { XpIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_Skill, WndID.WND_ID_LOADINGWARVIEW, 1, xpConfig.nIconID); XpIcon.gameObject.SetActive(true); } else { XpIcon.gameObject.SetActive(false); } SummerIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_Skill, WndID.WND_ID_LOADINGWARVIEW, 1, data.nSupportSkill[0]); SummerIcon.gameObject.SetActive(SummerIcon.sprite != null); //HeadIcon int nSex = data.cmdPlayerVsDetails.nSex; if (nSex < (int)PERSON_SEX.SEX_MAX && nSex >= (int)PERSON_SEX.SEX_MALE) { HeadIcon.gameObject.SetActive(true); HeadIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PlayerHead, WndID.WND_ID_RANK_INVITE, 1, nSex + 1); } else { HeadIcon.gameObject.SetActive(false); } VocationText.text = data.szVocationName; VocationText.color = data.nCamp == data.nSelfCamp ? UDefines.CommomColor(ECommonColor.ECC_Blue1) : UDefines.CommomColor(ECommonColor.ECC_Red1); // Ob位加载界面,0阵营蓝色,1阵营红色 if (data.nSelfCamp < 0) { VocationText.color = data.nCamp == 0 ? UDefines.CommomColor(ECommonColor.ECC_Blue1) : UDefines.CommomColor(ECommonColor.ECC_Red1); } PlayerNameText.text = data.szPlayerName; PlayerNameText.color = data.nSelfInfo > 0 ? UDefines.CommomColor(ECommonColor.ECC_Blue1) : UDefines.CommomColor(ECommonColor.ECC_White); if (data.nIsComputer > 0) { ReadText.text = "读取完毕"; ReadCountText.text = "100%"; m_bUpdate = false; } else { ReadText.text = "读取中"; ReadCountText.text = "0%"; m_bUpdate = true; } this.gameObject.SetActive(true); }
// 战场初始化数据 public void InitLoadingPlayerFrameInfo(IntPtr ptrParam, int nLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nLen); cmd_Camp_Count cmdCount = helper.get <cmd_Camp_Count>(); int nMatchType = cmdCount.nMatchType; int nMapId = cmdCount.nMapID; int nSelfCamp = 0; // 自己皮肤列表 List <int> self_hero_skin_list = new List <int>(); // 友方皮肤列表 List <int> friend_hero_skin_list = new List <int>(); // 敌方皮肤列表 List <int> enemy_hero_skin_list = new List <int>(); // XP技能列表 List <int> hero_xp_list = new List <int>(); // 有效玩家数据列表,吃鸡地图只加载右方信息 List <cmd_match_load_scene_playerinfo> player_info_list = new List <cmd_match_load_scene_playerinfo>(); foreach (int nCampCount in cmdCount.vCampCount) { for (int i = 0; i < nCampCount; ++i) { cmd_match_load_scene_playerinfo data = helper.get <cmd_match_load_scene_playerinfo>(); // 有效的英雄ID,有效皮肤ID if (data.nHeroID <= 0 || data.nSkinID <= 0) { continue; } // 自己皮肤 if (data.nSelfInfo == 1) { self_hero_skin_list.Add(data.nSkinID); nSelfCamp = data.nSelfCamp; } // 友方 else if (data.nSelfCamp == data.nCamp) { friend_hero_skin_list.Add(data.nSkinID); } // 敌方 else { enemy_hero_skin_list.Add(data.nSkinID); } // 有效XP if (data.nXPSkillID > 0) { hero_xp_list.Add(data.nXPSkillID); } // 吃鸡模式只加右方,其他模式全加 if (nMatchType == (int)EMMatchType.MatchType_MultiCampMatch) { if (data.nSelfCamp == data.nCamp) { player_info_list.Add(data); } } else { player_info_list.Add(data); } } } // 设置显示数据 m_wndView.SetData(nMatchType, nMapId, nSelfCamp, cmdCount.vCampCount, player_info_list); List <SkinPreLoadInfo> skins = new List <SkinPreLoadInfo>(); List <int> self_skins = new List <int>(); List <int> friend_skins = new List <int>(); List <int> enemy_skins = new List <int>(); // 预加载皮肤 foreach (int nSkinID in self_hero_skin_list) { SkinPreLoadInfo info = new SkinPreLoadInfo(); info.skinID = nSkinID; info.nMask |= (int)CachePriority.PRIORITY_VERY_HIGH; List <SkinPreLoadInfo> relateSkinList = SkinHelper.PreLoadPlayerSkin(info); skins.AddRange(relateSkinList); foreach (SkinPreLoadInfo peri in relateSkinList) { self_skins.Add(peri.skinID); } } foreach (int nSkinID in friend_hero_skin_list) { SkinPreLoadInfo info = new SkinPreLoadInfo(); info.skinID = nSkinID; info.nMask |= (int)CachePriority.PRIORITY_HIGH; List <SkinPreLoadInfo> relateSkinList = SkinHelper.PreLoadPlayerSkin(info); skins.AddRange(relateSkinList); foreach (SkinPreLoadInfo peri in relateSkinList) { friend_skins.Add(peri.skinID); } } foreach (int nSkinID in enemy_hero_skin_list) { SkinPreLoadInfo info = new SkinPreLoadInfo(); info.skinID = nSkinID; info.nMask |= (int)CachePriority.PRIORITY_MEDIUM; List <SkinPreLoadInfo> relateSkinList = SkinHelper.PreLoadPlayerSkin(info); skins.AddRange(relateSkinList); foreach (SkinPreLoadInfo peri in relateSkinList) { enemy_skins.Add(peri.skinID); } } SkinHelper.PreLoadMonsterSkin(nMapId); LightingEffectFactory.Instance.AcitvieLoadingSceneQueue(); // 预加载皮肤对应的光效 EffectHelper.LoadPreLights(nMapId, ASpeedGame.Data.Scheme.LightType.ActorSkin, self_skins, CachePriority.PRIORITY_VERY_HIGH); EffectHelper.LoadPreLights(nMapId, ASpeedGame.Data.Scheme.LightType.ActorSkin, friend_skins, CachePriority.PRIORITY_HIGH); EffectHelper.LoadPreLights(nMapId, ASpeedGame.Data.Scheme.LightType.ActorSkin, enemy_skins, CachePriority.PRIORITY_MEDIUM); // 预加载XP技能对应的光效 EffectHelper.LoadPreLights(nMapId, ASpeedGame.Data.Scheme.LightType.XP, hero_xp_list, CachePriority.PRIORITY_LOW); LightingEffectFactory.Instance.UnAcitvieLoadingSceneQueue(); }