Click Event Implementation Problem

I have this Clicked behaviour attached to a camera:

public class Clicked : MonoBehaviour {	
	
	//stores the object that received MouseDown for consumption by the iterator
    private RaycastHit originalHit;
	
	void Update () {
		if (!Input.GetMouseButtonDown(0)){
            //mouse not being clicked
            return;
        }

        var camera = Camera.main;
        
        if (!Physics.Raycast(camera.ScreenPointToRay(Input.mousePosition), out originalHit, 100)){
			print ("no object being clicked by mouse");
            return;
        }
		
		var eventsBehaviour = originalHit.transform.GetComponent<SubscribedEvents>();
		if(eventsBehaviour == null 
			|| !(eventsBehaviour is ISubscribeClicked)){
			print ("no event subscriptions or does not subscribe to Clicked event");
			return;
		}
		
		StartCoroutine(WaitOnUp(originalHit));
	}
	
	//waits on the mouse to be released on this object so that it only acts
	//upon a mouse click that was completely on this object
	IEnumerator WaitOnUp(RaycastHit hit){
        while (!Input.GetMouseButtonUp(0)){
			yield return 0;
		}
		if(!Physics.Raycast(camera.ScreenPointToRay(Input.mousePosition), out hit, 100)){
			print ("MouseUp not on an object");
		}
		else if(hit.GetHashCode () != originalHit.GetHashCode ()){
			print("MouseUp on a different object");
		}
		else{
			//object received MouseDown and then MouseUp, so fire its OnClicked event
			print ("MouseUp on original object");
			(originalHit.transform.GetComponent<SubscribedEvents>() as ISubscribeClicked).OnClicked();
		}
	}
}

However, if I quickly move the mouse to a different object after ensuring that MouseUp has occurred on the original object, I will see “MouseUp on a different object”. Due to seeing this, it seems like calling

yield return 0

causes the program to not re-enter into the iterator every frame, as in it just skips some frames before re-entering. Is that true?

I thought GetHashCode was implemented for RaycastHit. Apparently it wasn’t, and thus my comparison at line 38 was failing whenever the mouse moved between MouseDown and MouseUp. GetHashCode is incorrect to use anyway, but it would have not worked in a different way. I used hit.transform.name instead, which probably isn’t the best idea, but it will work for now.