using UnityEngine;

public class Garbage : MonoBehaviour
{
    public void OnTriggerEnter2D(Collider2D _collision)
    {
        Destroy(_collision.gameObject);
    }

    public void OnCollisionEnter2D(Collision2D _collision)
    {
        if (_collision.gameObject.transform.parent)
        {
            Destroy(_collision.gameObject.transform.parent.gameObject);
        }
        else
        {
            Destroy(_collision.gameObject);
        }
    }
}
