private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Interactionnable")) { interactable = other.GetComponent <Interactionnable>(); } }
private void OnTriggerExit2D(Collider2D other) { if (other.CompareTag("Interactionnable")) { if (interactable != null) { interactable.StopInteraction(); interactable = null; } } }