26 lines
569 B
C#
26 lines
569 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class TriggerDetection : MonoBehaviour
|
|
{
|
|
public Action<Collider> onTriggerEnter;
|
|
public Action<Collider> onTriggerStay;
|
|
public Action<Collider> onTriggerExit;
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
onTriggerEnter?.Invoke(other);
|
|
}
|
|
|
|
private void OnTriggerStay(Collider other)
|
|
{
|
|
onTriggerStay?.Invoke(other);
|
|
}
|
|
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
onTriggerExit?.Invoke(other);
|
|
}
|
|
}
|