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