Ejemplo n.º 1
0
 public void OnTriggerEnter(Collider other)
 {
     if (other.tag == "PlayerInteractable" || other.tag == "HittableObject")
     {
         PlayerInteractable interactable = other.GetComponent <PlayerInteractable>();
         if (interactable.affectsEnemy)
         {
             interactable.Interact(this.moveableObject);
         }
     }
 }
Ejemplo n.º 2
0
    public void OnTriggerEnter(Collider other)
    {
        if (!canMove)
        {
            return;
        }

        if (other.tag == "PlayerInteractable" || other.tag == "HittableObject")
        {
            PlayerInteractable interactable = other.GetComponent <PlayerInteractable>();
            interactable.Interact(this.moveableObject);
        }
    }