Beispiel #1
0
 private void CloseDoor()
 {
     OnDoorClosed?.Invoke(true);
     animator.SetTrigger(closeDoorTriggerAnimator);
     collider.isTrigger = false;
     opened             = false;
 }
Beispiel #2
0
    private void OnTriggerExit(Collider other)
    {
        PlayerInventoryManager playerInventory = other.GetComponent <PlayerInventoryManager>();

        if (playerInventory != null && playerInventory.Inventory.keys.Count > 0)
        {
            if (opened)
            {
                CloseDoor();
            }
            else
            {
                OnDoorClosed?.Invoke(false);
            }
        }
    }
Beispiel #3
0
 void TriggerCloseDoor()
 {
     OnDoorClosed.Invoke();
 }