detect click on collider like button

OnMouseDown();

that one detects click. but what i want to do is making OnMouseUp() like a button
the ui button doesnt work if user drag out of its place.

how can i make OnMouse~~() possible to cancle like ui button?
will be much better without using raycast.

public void OnMouseUpAsButton()
{
card.CardSelected();
}

this does what i ment