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