Пример #1
0
 public void AttemptDrop(ActionInventorySlot slot)
 {
     if (remainingActions > 0)
     {
         Location location = character.GetLocation();
         if (location.canPlaceItem)
         {
             location.PlaceItem(slot.DropItem());
             character.PlayDrop();
             Item currentItem = null;
             Item nextItem    = null;
             for (int action = 0; action <= slots.Length; action++)
             {
                 ActionInventorySlot currentSlot = slots[action];
                 nextItem = currentSlot.DropItem(false);
                 if (currentItem)
                 {
                     currentSlot.PickUp(currentItem, null);
                 }
                 if (currentSlot == slot)
                 {
                     break;
                 }
                 currentItem = nextItem;
             }
             UseAction();
         }
     }
 }
Пример #2
0
    public void SetBeaconActive(bool active)
    {
        sr.sprite = active ? activeSprite : inactiveSprite;
        ActionInventorySlot slot = GetComponentInParent <ActionInventorySlot>();

        if (slot != null)
        {
            slot.UpdateIcon(this, sr.sprite);
        }
    }