using UnityEngine;

public class ExitStepDown : MonoBehaviour 
{

    public float StepDown = 0.25f;

    void OnTriggerEnter2D(Collider2D c)
    {
        if (c.transform.GetComponent<Human>() == null)
            return;

        Vector3 delta = (transform.position - c.transform.position);
        c.transform.position += delta.normalized * StepDown;
    }

    void OnTriggerExit2D(Collider2D c)
    {
        if (c.transform.GetComponent<Human>() == null)
            return;

        Vector3 delta = (transform.position - c.transform.position);
        c.transform.position -= delta.normalized * StepDown;
    }
}
