Using OnMouseOver and OnMouseDown

I am trying to make a virtual pet game and want to feed the pet.

I currently have it so that when you hover over the pet it opens its mouth using OnMouseOver. However, I only want it to open it’s mouth when being hovered over whilst the mouse is also down.

Is there any way to do this?

You can check for the status of the Mouse button inside of the OnMouseOver function.

private void OnMouseOver()
{
    if(Input.GetMouseButtonDown(0))
    {
        //do stuff
    }
}