public void Attack()
{
if (Vector3.Distance(transform.position, _player.transform.position) < MinDistance)
{
GetComponent<EnemySounds>().PlayAttackSound();
var hitContext = new HitContext
{
Force = 3,
Damage = Damage,
Direction = transform.forward,
IsMelee = true
};
_player.GetComponent<HealthBehavior>().TakeDamage(hitContext);
}
}
}