how to detect button click in unity 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); }