using System.Collections; using System.Collections.Generic; using UnityEngine; public class TriggerZone : MonoBehaviour { protected ShipPathFollower _ship; protected void OnTriggerEnter(Collider other) { if (other.gameObject.TryGetComponent(out ShipPathFollower ship)) { _ship = ship; InZone(); } } protected void OnTriggerExit(Collider other) { if (_ship != null) { OutZone(); _ship = null; } } protected virtual void InZone() { Debug.Log("InZone"); } protected virtual void OutZone() { Debug.Log("OutZone"); } }