unity onclick object

C#
 void Update () {
     
 }
  void OnMouseDown(){
         // this object was clicked - do something
     Destroy (this.gameObject);
  }   
Source

Also in C#: