private void OnTriggerExit(Collider other) { UnitHealth target = other.GetComponent <UnitHealth>(); if (target != null) { targets.Remove(target); } }
private void OnTriggerEnter(Collider other) { UnitHealth target = other.GetComponent <UnitHealth>(); if (target != null) { targets.Add(target); } }