Ejemplo n.º 1
0
 private void OnTriggerExit2D(Collider2D collision)
 {
     if (collision.tag == "PlayerInteractArea")
     {
         if (interactionGraphics != null && turnGraphicsOfOnExit)
         {
             interactionGraphics.SetActive(false);
         }
         if (interactableObjReferece != null)
         {
             _IsInteractable interactableObj = interactableObjReferece.GetComponent <_IsInteractable>();
             interactableObj.SetInteractable(false);
         }
     }
 }
Ejemplo n.º 2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "PlayerInteractArea")
     {
         if (interactionGraphics != null)
         {
             interactionGraphics.SetActive(true);
         }
         if (interactableObjReferece != null)
         {
             _IsInteractable interactableObj = interactableObjReferece.GetComponent <_IsInteractable>();
             interactableObj.SetInteractable(true);
             //setting the object to the player interactWith
             GameObject.FindWithTag("Player").GetComponent <Player>().SetObjectToInteract(interactableObjReferece);
         }
     }
 }