public void TriggerPlayerHitEvent() { PlayerHit playerHitEvent = PlayerHit.Create(); playerHitEvent.VictimEntity = SWExtensions.KartExtensions.GetKartWithID(SWMatchmaking.GetMyBoltId()).GetComponent <BoltEntity>(); playerHitEvent.Send(); }
private void SendPlayerHitEvent(Ownership itemOwnership) { PlayerHit playerHitEvent = PlayerHit.Create(); playerHitEvent.KillerID = itemOwnership.OwnerID; playerHitEvent.KillerName = itemOwnership.OwnerNickname; playerHitEvent.KillerTeam = (int)itemOwnership.Team; playerHitEvent.Item = itemOwnership.Label; playerHitEvent.VictimEntity = entity; playerHitEvent.VictimID = state.OwnerID; playerHitEvent.VictimName = GetComponentInParent <Multiplayer.PlayerInfo>().Nickname; playerHitEvent.VictimTeam = state.Team; playerHitEvent.Send(); }
private void SendPlayerHitAndRemove(Collider other) { IKartState victimKartState; BoltEntity victimEntity = other.GetComponentInParent <BoltEntity>(); if (victimEntity.TryFindState <IKartState>(out victimKartState)) { PlayerHit playerHitEvent = PlayerHit.Create(); playerHitEvent.KillerID = _ownership.OwnerID; playerHitEvent.KillerName = _ownership.OwnerNickname; playerHitEvent.KillerTeam = (int)_ownership.Team; playerHitEvent.Item = _ownership.Label; playerHitEvent.VictimEntity = victimEntity; playerHitEvent.VictimID = victimKartState.OwnerID; playerHitEvent.VictimName = victimEntity.GetComponent <PlayerInfo>().Nickname; playerHitEvent.VictimTeam = (int)victimKartState.Team; playerHitEvent.Send(); } else { Debug.LogError("Could not find the victim's attached state."); } TryRemoveFromLists(other); }