To detect whether the mouse overlaps with an object on the screen, it is not necessary to obtain the screen coordinates and borders of the object to perform complex calculations. Unity provides us with ray detection and also provides a way to convert mouse coordinates into rays.
// Camera.main.ScreenPointToRay(Input.mousePosition): Convert mouse coordinates to rays
// Physics.Raycast: X-ray Detection
if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit))
{
if (target_name == hit.collider.name)
{
// Do Something...
}
}