protected override void HitOpponent(Collider opponent) { PlayerBaseHealth player = opponent.GetComponent <PlayerBaseHealth>(); if (player) { player.GetDamage(Damage); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { PlayerBaseHealth playerHealth = other.GetComponent <PlayerBaseHealth>(); if (playerHealth) { playerHealth.GetDamage(_collisionDamage); _health.DieFromCollision(); } }