Пример #1
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.gameObject.CompareTag("collectable"))
        {
            if (!soundPlayed)
            {
                soundFX.GetComponent <AudioSource>().Play(0);
                soundPlayed = true;
            }

            collider.gameObject.SetActive(false);
            collisionController.addScore(150);
            setScoreText();
        }
    }