click objects in unity code example
Example 1: gameobject on click unity
private void OnMouseOver() {
Debug.Log("Hovering over GameObject");
}
Example 2: unity click object
void OnMouseDown()
{
// this object was clicked - do something
Destroy (this.gameObject);
}