1
0
mirror of https://projects.caleb-brown.dev/UDRI-XRT/UDRIGEEKCup2024.git synced 2025-01-22 15:18:25 -05:00
UDRIGEEKCup2024/Assets/Scripts/OnColliderTrigger.cs
2024-04-16 15:49:32 -04:00

28 lines
719 B
C#

using UnityEngine;
using UnityEngine.Events;
namespace MAVRIC.GEEKCup
{
public class OnColliderTrigger : MonoBehaviour
{
// TODO: Update this to use a UnityAtoms BoolReference
[SerializeField] private UnityEvent<bool> onTrigger;
private void OnTriggerEnter(Collider other)
{
// TODO: Update this to a different system
if (other.CompareTag("Player"))
{
onTrigger?.Invoke(false);
}
}
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
onTrigger?.Invoke(true);
}
}
}
}