A quick general question - when you have a gameobject with a collider, and you have a button attached to that gameobject, is it the expected behaviour that the button will never receive events like OnClick because the parent gameobject intercepted all the events? Is moving the button out so that it's on the same hierarchical level as the gameobject the only way to make it work?
Here's the scenario I'm working with. I have a UIDraggable Panel gameobject that contains several UIDrag Panel Contents gameobjects. I would like to add a button to the UIDrag Panel Contents gameobject and have the button react to mouse over/up/click events, which it currently doesn't because I suppose the collider in UIDrag Panel Contents gameobject has intercepted them, regardless the depth on the button.
The behaviour that will be really good to have is that any button underneath a UIDrag Panel Contents gameobject will react the same way as a clickable button/link under iOS. i.e. when a button is pressed it'll react normally, but if you then begin dragging the button will be released and the drag event passed onto the UIDrag Panel Contents gameobject so that the whole panel is dragged instead.
Currently I can't find a way to simulate this myself as the button doesn't seem to receive any events at all, and it's really messy having the button outside of the UIDrag Panel Contents gameobject as they belong together.
Just wondering if it's something that I'm doing wrong and if my suggestions make sense?
thanks,
Tommy