private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { Destroy(this.gameObject); FindObjectOfType <SoundManager>().Play("coin"); ScoreUI.IncrementScore(score); } }
private void OnTriggerEnter(Collider other) { if (other.tag == "Obstacle") { Destroy(this.gameObject); Destroy(other.gameObject); ScoreUI.score -= 5; } if (other.tag == "Enemy") { Destroy(this.gameObject); FindObjectOfType <SoundManager>().Play("death"); ScoreUI.IncrementScore(); SpawnManager.activeEnemies = 0; } }
public void IncrementScore(int amount) { scoreUI.IncrementScore(amount); }