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

public class FireEventAndDestroy : MonoBehaviour
{
    // Start is called before the first frame update
    [SerializeField] private GameEvent eventToFire;
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    void OnTriggerEnter(Collider c)
    {
        if (c.gameObject.layer == LayerMask.NameToLayer("Player"))
        {
            eventToFire.Raise();
            Destroy(this.gameObject);
        }
    }
}
