private void CheckTouchDamage()
{
if(Time.time >= lastTouchDamageTime + touchDamageCooldown)
{
touchDamageBotLeft.Set(touchDamageCheck.position.x - (touchDamageWidth / 2), touchDamageCheck.position.y - (touchDamageHeight / 2));
touchDamageTopRight.Set(touchDamageCheck.position.x + (touchDamageWidth / 2), touchDamageCheck.position.y + (touchDamageHeight / 2));
Collider2D hit = Physics2D.OverlapArena(touchDamageBotLeft, touchDamageTopRight, whatIsPlayer);
if(hit != null)
{
lastTouchDamageTime = Time.time;
attackDetails[0] = touchDamage;
attackDetails[1] = alive.transform.position.x;
hit.SendMessage("Damage", attackDetails);
}
}
}