private void GetNewHurtInfo(OpponentBattleInfo info) { _curInfoItem.Find("OpponentName").GetComponent <Text>().text = info.PlayerName; _curInfoItem.Find("IsKillIcon").gameObject.SetActive(info.IsKill); _curInfoItem.Find("HurtVal").GetComponent <Text>().text = info.Damage.ToString(); _curInfoItem.gameObject.SetActive(true); }
public void AddOpponentInfo(EntityKey key, int weaponId, bool isKill, bool isHitDown, float damage, PlayerInfoComponent playerInfo, int deathCount) { OpponentBattleInfo opponent = new OpponentBattleInfo();; bool containsFlag = false; if (Battle.OpponentDict.Count > 0) { foreach (OpponentBattleInfo obi in Battle.OpponentDict.Values) { if (obi.PlayerKey == key && obi.DeathCount == deathCount) { opponent = obi; containsFlag = true; break; } } } if (!containsFlag) { Battle.OpponentDict.Add(Battle.OpponentDict.Count, opponent); } if (!opponent.IsKill) { opponent.IsKill = isKill; } if (!opponent.IsHitDown) { opponent.IsHitDown = isHitDown; } opponent.TrueDamage += damage; opponent.Damage = (int)opponent.TrueDamage; opponent.DeathCount = deathCount; SetBattleInfo(key, weaponId, playerInfo, opponent, 0L); }
public void AddOtherInfo(EntityKey key, int weaponId, bool isKill, bool isHitDown, float damage, PlayerInfoComponent playerInfo, long timestamp) { OpponentBattleInfo other; Battle.OtherDict.TryGetValue(key, out other); if (null == other) { other = new OpponentBattleInfo(); Battle.OtherDict.Add(key, other); } if (!other.IsKill) { other.IsKill = isKill; } if (!other.IsHitDown) { other.IsHitDown = isHitDown; } other.TrueDamage += damage; other.Damage = (int)other.TrueDamage; SetBattleInfo(key, weaponId, playerInfo, other, timestamp); }
public void Handle(INetworkChannel networkChannel, int messageType, object messageBody) { var message = messageBody as BattleStatisticsMessage; if (null == message) { return; } PlayerEntity player = _contexts.player.flagSelfEntity; BattleData data = player.statisticsData.Battle; data.Killer.PlayerLv = message.Killer.PlayerLv; data.Killer.PlayerName = message.Killer.PlayerName; data.Killer.BackId = message.Killer.BackId; data.Killer.TitleId = message.Killer.TitleId; data.Killer.BadgeId = message.Killer.BadgeId; data.Killer.WeaponId = message.Killer.WeaponId; data.Killer.DeadType = (EUIDeadType)message.Killer.DeadType; foreach (var opponent in message.Opponents) { OpponentBattleInfo info = new OpponentBattleInfo(); info.PlayerLv = opponent.PlayerLv; info.PlayerName = opponent.PlayerName; info.BackId = opponent.BackId; info.TitleId = opponent.TitleId; info.BadgeId = opponent.BadgeId; info.WeaponId = opponent.WeaponId; info.IsKill = opponent.IsKill; info.Damage = opponent.Damage; data.OpponentList.Add(info); } //player.statisticsData.IsShow = true; _contexts.ui.uISession.UiState[UiNameConstant.CommonTechStatModel] = true; }