public void ApplyDamage(float damage) { if (PhotonNetwork.isMasterClient) { health -= damage; if (health <= 0) { egManager.EndGame(false); PhotonNetwork.Destroy(gameObject); } } }