public void AttackTarget() { if (AttackSpeed > 0 && timeSinceLastAttack < 1.0f / AttackSpeed) { return; } CurrentTarget.TakeDamageFrom(this); timeSinceLastAttack = 0.0f; if (CurrentTarget.IsDead) { CurrentTarget = null; } }