I have a prefab which contains several objects (say, a plane and 3dtext). I want to detect mouse clicks on this prefab. I made a script with OnMouseDown() function, put it on the Prefab (top leve), I get no clicks. So my questions are:
If there are multiple things in a group, do you have to put the OnMouseDown() on each item in the group? If so, what's the cleanest way to signal that this group was clicked?
Is there a way to have one function intercept mouse clicks on ANY member of a group (what I was hoping).
Am I going about this all wrong, should I be using something else?
My code:
function OnMouseDown()
{
setDataSpotLabelText("clicked");
}
public function setDataSpotLabelText(s)
{
t = gameObject.GetComponentInChildren(TextMesh);
t.text = s;
}