public static HeroDescription Instance() { if (mSingleton == null) { mSingleton = new HeroDescription(); } return(mSingleton); }
public void SetPlayerInfo(bool isAutoSelect, Dictionary <int, PartyIconColor> playerPartyIcons, Dictionary <long, string> matchAwardDictionary) { var playerInfo = Database.ReplaysDb().HotsPlayer.ReadRecordFromPlayerId(Player.PlayerId); Hero hero = HeroesIcons.HeroesData(Build).HeroData(Player.Character, includeAbilities: false, additionalUnits: false); LeaderboardPortrait = Player.Character != "None" ? hero.HeroPortrait.LeaderboardImage() : null; Silenced = Player.IsSilenced; VoiceSilenced = Player.IsVoiceSilenced; CharacterName = hero.Name; PlayerName = Database.SettingsDb().UserSettings.IsBattleTagHidden ? HeroesHelpers.BattleTags.GetNameFromBattleTagName(playerInfo.BattleTagName) : playerInfo.BattleTagName; PlayerBattleTagName = playerInfo.BattleTagName; PlayerRegion = (Region)playerInfo.BattleNetRegionId; IsUserPlayer = (playerInfo.PlayerId == UserProfile.PlayerId && playerInfo.BattleNetRegionId == UserProfile.RegionId) ? true : false; HasActiveBoost = Player.HasActiveBoost; if (Player.Team == 4) { CharacterLevel = "Observer"; } else { CharacterLevel = isAutoSelect ? "Auto Select" : Player.CharacterLevel.ToString(); } PlayerTag = new PlayerTag { PlayerName = PlayerName, AccountLevel = Player.AccountLevel > 0 ? Player.AccountLevel.ToString() : "N/A", TotalSeen = playerInfo.Seen, LastSeenBefore = playerInfo.LastSeenBefore.HasValue ? playerInfo.LastSeenBefore.Value.ToString() : "Never", FormerPlayerNames = Database.ReplaysDb().RenamedPlayer.ReadPlayersFromPlayerId(playerInfo.PlayerId), Notes = playerInfo.Notes ?? string.Empty, }; HeroDescription = new HeroDescription { HeroName = hero.Name, Description = hero.Description.ColoredText, Franchise = hero.HeroFranchiseImage(), Type = hero.Type, Difficulty = hero.Difficulty, Roles = hero.Roles.ToList(), ExpandedRole = hero.ExpandedRole, }; if (playerPartyIcons.ContainsKey(Player.PlayerNumber)) { SetPartyIcon(playerPartyIcons[Player.PlayerNumber]); } if (matchAwardDictionary.ContainsKey(Player.PlayerId)) { SetMVPAward(matchAwardDictionary[Player.PlayerId]); } }
/// <summary> /// 更新数据显示 /// </summary> public void UpdateInfo() { if (UpGradeStar.gameObject.activeSelf) { UpGradeStar.RefreshDrug(hd); } UpGradeStar.RefreshSoulStone(hd); heroDes.RefreshDesInfo(); heroDes.SetDingweiAndTedian(); NameArea.RefreshUI(hd); breakthrough.RefreshUI(hd); if (Runes.gameObject.activeSelf) { Runes.RefreshRunes(); } //hd = playerData.GetInstance().selectHeroDetail; //if (EquipPanel.instance) if (HeroAndEquipNodeData.TanNUm == 3) { EquipPanel.instance.ShowEquip(hd); } if (HeroAndEquipNodeData.TanNUm == 4) { HeroSkill.RefreshSkill(hd); } //if (HeroSkill.gameObject.activeSelf) WearRunes(); float length = UI_HeroDetail.hd.node.GetStarGrowUpRate(0, UI_HeroDetail.hd.star); strengthGrowthLabel.text = "" + length; PowerProgress.width = HeroDescription.Instance().GetProgressLength(length); length = UI_HeroDetail.hd.node.GetStarGrowUpRate(1, UI_HeroDetail.hd.star); intelligenceGrowthLabel.text = "" + length; IntelligenceProgress.width = HeroDescription.Instance().GetProgressLength(length); length = UI_HeroDetail.hd.node.GetStarGrowUpRate(2, UI_HeroDetail.hd.star); agileGrowthLabel.text = "" + length; AgilityProgress.width = HeroDescription.Instance().GetProgressLength(length); SetUpgradeProperty(); }