using System; using UnityEngine; public class ThresholdRichHandler : MonoBehaviour { public event Action onThresholdZone; private void OnTriggerEnter(Collider other) { ThresholdRichZone zone = other.GetComponentInParent(); if (!(zone == null) && !zone.isUse && this.onThresholdZone != null) { this.onThresholdZone(zone); } } }