using System; using UnityEngine; public class AIHandler : MonoBehaviour { public event Action onAIDisable; private void OnTriggerEnter(Collider other) { AIBase ai = other.GetComponentInParent(); if (ai != null) { this.onAIDisable?.Invoke(ai); } } }