- golgepapaz
- Posts: 43
- Joined:
HitTest in Unity
I am trying to capture whether a mouse event (Left click, Double click etc) happened on NoesisGuiPanel (meaning any visible GUI element) in order to refrain from interacting with game objects in the scene.
I've looked VisualTreeHelper::HitTest() but this did not go anywhere part for not really knowing how to use it and the HitTestResult in Noesis seems to not expose any properties that is useful in Unity.
Any help would be greatly appreciated.
I've looked VisualTreeHelper::HitTest() but this did not go anywhere part for not really knowing how to use it and the HitTestResult in Noesis seems to not expose any properties that is useful in Unity.
Any help would be greatly appreciated.
-
sfernandez
Site Admin
- Posts: 3154
- Joined:
Re: HitTest in Unity
This should have already been done by our NoesiGUIPanel component. If you look at Plugins/NoesisGUI/Scripts/Core/NoesisUIRenderer.cs on ProcessEvent() function, we do a hit test to check if mouse action occurred over the GUI, calling event.Use() accordingly.I am trying to capture whether a mouse event (Left click, Double click etc) happened on NoesisGuiPanel (meaning any visible GUI element) in order to refrain from interacting with game objects in the scene.
Isn't working for you or maybe you need to control hit testing yourself?
You are right, HitTestResult is not exposing correctly the required info to Unity API. We will add in our next release.I've looked VisualTreeHelper::HitTest() but this did not go anywhere part for not really knowing how to use it and the HitTestResult in Noesis seems to not expose any properties that is useful in Unity.
Any help would be greatly appreciated.
Who is online
Users browsing this forum: maherne and 1 guest