OnMouseNotOver instead of OnMouseExit?

OnMouseExit is only called once when the mouse exits the collider. SOmetimes this doesnt register(frame rate issues I think) so I wanted to run continous checks. Is there a way this can be done?

Something like a OnMouseNotOver function would be grand. Any way to do this?


As far as I know, the OnMouseWhatever callbacks are executed before the Update/LateUpdate (see this page). So what you can do is create a member variable:

private bool _didMouseOverOccurThisframe = false;

Then, inside your OnMouseOver():

void OnMouseOver() 
    _didMouseOverOccurThisframe = true;

Then, inside your Update/LateUpdate:

void Update()
    if(!_didMouseOverOccurThisframe ) OnMouseNotOver();

    _didMouseOverOccurThisframe = false;

    // .. stuff ..