Ejemplo n.º 1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            playerScript player = other.GetComponent <playerScript>();

            if (player != null)
            {
                player.addCoins();
            }

            Destroy(this.gameObject);
        }
    }