Ejemplo n.º 1
0
    //Carrot
    void OnTriggerEnter2D(Collider2D other)
    {
        Carrot c = other.GetComponent <Carrot>();

        if (c != null)
        {
            c.DestroyCarrot();
        }
        else
        {
            Destroy(other.gameObject);
        }
    }