unity click on ui object code example
Example: unity click object
void OnMouseDown()
{
// this object was clicked - do something
Destroy (this.gameObject);
}
void OnMouseDown()
{
// this object was clicked - do something
Destroy (this.gameObject);
}