public void OnSelectHeroSkin(int userId, string skinId) { ReadyPlayerSampleInfo readyPlayerSampleInfo = this.TryFindPlayerInfo(userId, "OnSelectHeroSkin"); if (readyPlayerSampleInfo != null) { readyPlayerSampleInfo.heroSkinId = skinId; HeroSkins.SetHeroSkin(this.GetTeam(userId), this.GetPlayerHero(userId), int.Parse(skinId)); MobaMessageManager.DispatchMsg(ClientC2C.PvpSelectHeroSkin, new ParamSelectHeroSkin(userId, skinId)); } }
public static void UpdateHeroSkins(IEnumerable <ReadyPlayerSampleInfo> allPlayers) { HeroSkins.Clear(); foreach (ReadyPlayerSampleInfo current in allPlayers) { if (!string.IsNullOrEmpty(current.heroSkinId)) { int skinIdx = 0; if (int.TryParse(current.heroSkinId, out skinIdx)) { HeroSkins.SetHeroSkin(PvpProtocolTools.GroupToTeam((int)current.group), current.heroInfo.heroId, skinIdx); } } } }