Exemplo n.º 1
0
    void OnCollisionEnter2D(Collision2D col)
    {
        if (col.gameObject.name == "Player")
        {
            Destroy(col.gameObject);

            GameObject deathsManagerObject = GameObject.FindGameObjectWithTag("deaths");
            Deaths     deaths = deathsManagerObject.GetComponent <Deaths> ();

            deaths.Increase();
        }
    }