Пример #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "Player")
        {
            theScoreManager.AddPoints(pointsAdded);
            gameObject.SetActive(false);

            if (collectableSound.isPlaying)
            {
                collectableSound.Stop();
                collectableSound.Play();
            }
            else
            {
                collectableSound.Play();
            }
        }
    }