If I have the following line:
GUI.Box(Rect.MinMaxRect(0.0f, 0.0f, Screen.width, Screen.height),new GUIContent(GUIFullGraphic));
Notice that this box covers the entire range of pixels on the screen.
Any Object in the scene that has OnMouseEnter() or OnMouseExit() functions do not process these functions unless a mouse input button is pressed.
These are the functions that stop processing when I have the above GUI.Box drawn.
void OnMouseEnter()
{
print(transform.GetInstanceID() + "; On Mouse Enter");
MouseOver = true;
renderer.material.color = Color.red;
}
void OnMouseExit()
{
print(transform.GetInstanceID() + "; On Mouse Exit");
MouseOver = false;
renderer.material.color = Color.white;
}
if I then press one of the mouse input buttons the OnMouseEnter() and OnMouseExit functions do process for 1 frame. If I continue to hold down the mouse button, the events will not fire again until I release the input and press it down again.
The reason I am using a GUI.Box that fills the entire screen is to display a masking texture to overlay the scene. (the GUI.Box background color is set to completely transparent).
This appears to be a bug, unless the GUI.Box was never designed to cover the entire screen and still receive input events from objects in the scene. Is there an alternate way to display a full screen transparent mask image that won’t affect the OnMouseEnter and OnMouseExit events?