- Home /
Detecting mouse over UI element with preview package UIElement runtime?
Does anyone know if there is a similar way to know if the mouse is over a UI element with the new UIElement runtime preview package as you can do with EventSystem.current.IsPointerOverGameObject() with the current UI system (so that if I click a UI element, I don't trigger any game logic that might be tied to the same mouse button)?
UPDATE: I could (and have something that seems to work at a basic level) create a static class that stores whether the mouse is over an ui element and then have a script that sets that value on mouse enter / leave events and add that to all elements but that seems a bit hacky (but if this is anything like the web, that can be very temperamental which hopefully is not the case) and was wondering if there was already something that does that.