Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            Destroy(this.gameObject);
            FindObjectOfType <SoundManager>().Play("coin");

            ScoreUI.IncrementScore(score);
        }
    }
Пример #2
0
    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;
        }
    }
Пример #3
0
 public void IncrementScore(int amount)
 {
     scoreUI.IncrementScore(amount);
 }