public void OnTriggerEnter(Collider other) { if (other.transform.tag == forTaggedGO) { PhotonPlayer player = other.GetComponent <PhotonView>().owner; if (player != null && other.GetComponent <PhotonView>().isMine && player.GetAttribute <bool>(PlayerAttributes.HASSPAWNED, false) && player.GetPlayerState() == PlayerState.inGame) { int team = player.getTeamID(); //verification de l'équipe du joueur present dans la zone if (team == 1) { if (PhotonNetwork.room.GetRoomState() == GameState.RoundRunning) { player.AddPlayerScore(PointGenere); PhotonNetwork.room.AddTeamScore(1, PointGenere); } Manager_game.ActiveZonesList.Remove(gameObject); //destruction de la zone photonView.RPC("rpc_UnspawnThiefZone", PhotonTargets.MasterClient); } } } }
void OnDeath() { m_lastHit.AddPlayerScore(1); if (PlayerDeathEvent != null) { PlayerDeathEvent(); } PhotonNetwork.Destroy(gameObject); }