using UnityEngine;

using System;
using System.Collections;

public class PlatformerCollision : MonoBehaviour
{
    private BoxCollider2D _Collider = null;

    void Start()
    {
        Transform p = transform.parent;

        if (p != null)
        {
            _Collider = (BoxCollider2D)p.GetComponent(typeof(BoxCollider2D));
        }
    }

    void OnTriggerEnter2D(Collider2D collider)
    {
        Physics2D.IgnoreCollision(collider, _Collider, true);
    }

    void OnTriggerExit2D(Collider2D collider)
    {
        Physics2D.IgnoreCollision(collider, _Collider, false);
    }
}
