示例#1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.name == "TriggerPoint")
        {
            spawn.GetSpawn();
        }

        if (other.gameObject.tag == "addPoint")
        {
            AudioSource.PlayClipAtPoint(coinSound, transform.position, 1f);
            Destroy(other.gameObject);
            coinCounter++;

            totalCoins.text = "Coins:" + PlayerMovement.coinCounter;
        }
    }