示例#1
0
    private void AddToBackpack()
    {
        //Debug.Log("added to packpack");
        canBePickedUp = false;
        currentState  = ItemState.InBackpack;
        playerInventory.AddItemToBackpack(this);
        DisableChildrenAndColliders();

        if (isVictoryItem)
        {
            PlayerData.current.isBrutalUnlocked = true;
            playerInventory.gameObject.GetComponent <PlayerController>().WinGame();
        }
    }
 private void HandleButtonClick()
 {
     if (isFilled)
     {
         if (playerInventory.eatItemButton.isHighlighted)
         {
             EatItem();
             RemoveItemFromSlot();
         }
         else
         {
             if (isBackpackSlot)
             {
                 EquipItemInSlot();
             }
             else
             {
                 playerInventory.AddItemToBackpack(itemInSlot);
                 RemoveItemFromSlot();
             }
         }
     }
 }