// When target is clicked, destroy it, update score, and generate explosion private void OnMouseDown() { if (gameManagerX.isGameActive) { Destroy(gameObject); gameManagerX.UpdateScore(pointValue); Explode(); } }
// 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(); } } }