// When target is clicked, destroy it, update score, and generate explosion
 private void OnMouseDown()
 {
     if (gameManagerX.isGameActive)
     {
         Destroy(gameObject);
         gameManagerX.UpdateScore(pointValue);
         Explode();
     }
 }
Example #2
0
 // When target is clicked, destroy it, update score, and generate explosion
 private void OnMouseDown()
 {
     if (gameManagerX.isGameActive)
     {
         Destroy(gameObject);
         gameManagerX.UpdateScore(pointValue);
         Explode();
         if (gameObject.CompareTag("Bad"))
         {
             gameManagerX.GameOver();
         }
     }
 }