detect button click 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); }