golgepapaz
Topic Author
Posts: 43
Joined: 01 Aug 2013, 01:59

HitTest in Unity

31 Aug 2013, 22:26

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.
 
User avatar
sfernandez
Site Admin
Posts: 3154
Joined: 22 Dec 2011, 19:20

Re: HitTest in Unity

02 Sep 2013, 23:59

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.
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.

Isn't working for you or maybe you need to control hit testing yourself?
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.
You are right, HitTestResult is not exposing correctly the required info to Unity API. We will add in our next release.

Who is online

Users browsing this forum: maherne and 1 guest