public void Kill() { levelHandler.AddScore(points); levelHandler.DestroyTarget(); Destroy(this.gameObject); }
private void Kill() { Instantiate(ParticlePrefab, transform.position, transform.rotation); GameObject sa = Instantiate(ScoreTextPrefab, transform.position, transform.rotation) as GameObject; sa.GetComponent <TextMesh>().text = score.ToString(); levelhandler.AddScore(score); Destroy(this.gameObject); }