holopy3/Assets/Scripts/PassTheEdgeTrigger.cs

19 lines
410 B
C#
Raw Normal View History

2021-01-28 12:07:52 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PassTheEdgeTrigger : MonoBehaviour
{
public delegate void ThresholdEdge();
public static event ThresholdEdge OnPassingTheEdge;
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag("PlayerBody"))
{
OnPassingTheEdge?.Invoke();
}
}
}