As part of a menu system, I want to put a collider over certain parts of the UI after a certain event that will respond to a click, but also count as a click for whatever happens to be below it.
Is there some way that I can disable all of those colliders in the colliders' OnClick function, and from there send another click as though the user had pressed again?
I know I can SendMessage("OnClick") to a specific element, but I want it to just go to wherever the user clicked.
I suppose the alternative to all this is to do a raycast from the UICamera manually, and then send OnClick to whatever collider is encountered there... is there a quick way to do this? GetObjectUnderMouse or something?
Cheers,
Tom
Edit: I've achieved this by making UICamera.Raycast public and calling it like this:
RaycastHit hit
= new RaycastHit
(); GameObject go = UICamera.Raycast(Input.mousePosition, ref hit) ? hit.collider.gameObject : UICamera.fallThrough;