VisualtreeHelper not catching click on ComboBox
Posted: 19 Oct 2014, 17:18
Hello.
I tried to use VisualTreeHelper to stop clicks from going trough the GUI to the underlaying GameObjects.
And this seem to work fine except when I click on a item in a ComboBox. Is there a way to get around this?
The code I use.
I tried to use VisualTreeHelper to stop clicks from going trough the GUI to the underlaying GameObjects.
And this seem to work fine except when I click on a item in a ComboBox. Is there a way to get around this?
The code I use.
Code: Select all
...
root = Camera.main.GetComponent<NoesisGUIPanel>().GetRoot<Grid>();
}
...
#if UNITY_EDITOR
private void OnMouseDown()
{
var hit = VisualTreeHelper.HitTest(root, new Point(Input.mousePosition.x, Input.mousePosition.y));
if (hit.visualHit == null)
{
if (_gridMngr.GetCellOccupied())
_gui.OpenMenuComponent();
else
_gui.OpenMenu();
}
}
#endif
