public bool TestCollision(Vector2 p, float radius)
{
if (!isValid)
{
return false;
}
var rx = Mathf.Clamp(x * pongpector.width, width / 2 + 1, pongpector.width - width / 2 - 1);
var w = width + radius * 2;
var h = height + radius * 2;
var rect = new Rect(rx - (w / 2), y - (h / 2), w, h);
return rect.Contains(p);
}
}