Hey folks.
I have a UI overlay that covers the screen in the project I'm working on, and then a little window in the middle that shows the "worldspace" of the game. The player can click to move around in the worldspace, so I manually took over checking for graphics raycasts on click, and I have the inverse mask that defines the window as a raycast target to define the area of valid movement clicks.
I'm running into an issue with this approach, though. I have a new underlay UI that I'd like to have pop up - inside the worldspace - and it has buttons on it. I'd like these buttons to act like other UI buttons, with the fancy color tints on highlights and presses and all that. Currently, since the entire worldspace is already defined by a raycast target, it's blocking the raycasts to the underlay UI - and since I need that raycast target to determine the world space, I can't just turn it off.
Is there an elegant way to selectively penetrate my overlay raycast target? Do I need to manually re-do all the functionality of Unity's UI Buttons, or is there a way to override the graphics raycaster's natural interaction with the UI?
Any help would be greatly appreciated!
↧