Пример #1
0
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player") && !other.isTrigger)
     {
         context.Raise();
         playerInRange = true;
     }
 }
Пример #2
0
 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;
 }