public void OnTriggerExit2D(Collider2D collision) { if (collision.GetComponent <ILockable>() != null) { ILockable lockable = collision.GetComponent <ILockable>(); if ((lockable as ShipLocked).GetCamp() != GetCamp()) { lockable.CancelLock(); targetList.Remove((lockable as MonoBehaviour).transform); } } }