using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

public class PlayerTriggerEvent : MonoBehaviour
{
    public UnityEvent onEnter, onExit;

    private void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player")) { onEnter.Invoke(); }
    }

    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.CompareTag("Player")) { onEnter.Invoke(); }
    }

    private void OnTriggerExit(Collider other)
    {
        if (other.CompareTag("Player")) { onExit.Invoke(); }
    }

    private void OnTriggerExit2D(Collider2D other)
    {
        if (other.CompareTag("Player")) { onExit.Invoke(); }
    }
}
