private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player") && !other.isTrigger) { context.Raise(); playerInRange = true; } }
public void OpenChest() { dialogBox.SetActive(true); dialogText.text = contents.itemDescription; playerInventory.AddItem(contents); playerInventory.currentItem = contents; // raise the signal to the player to animate raiseItem.Raise(); context.Raise(); // set the chest to opened isOpen = true; anim.SetBool("opened", true); storedOpen.runtimeValue = isOpen; }