protected override void OnTriggerEnter(Collider other) { base.OnTriggerEnter(other); if (other.gameObject.layer == TankEternalGameSettings.EnemyLayerId) { var vitality = other.GetComponent <TankEternalEnemyPawn>().Vitality; vitality.AddHealth(-TankEternalGameSettings.CalculateRealDamage(Damage, vitality)); } }
private void OnCollisionEnter(Collision other) { if (other.gameObject.layer == TankEternalGameSettings.PlayerLayerId) { gameObject.SetActive(false); var vitality = PlayerPawn.Vitality; vitality.AddHealth(-TankEternalGameSettings.CalculateRealDamage(Damage, vitality)); } }