예제 #1
0
    public void InitSlot(string name, PickAndMountItem pickedItem)
    {
        itemName       = name;
        itemPickUpType = pickedItem;

        GetComponentInChildren <Text>().text = name;
    }
    public ItemSlot GetItemSlotForPickAndMountItem(PickAndMountItem pickAndMountItem)
    {
        foreach (var itemSlot in itemSlots)
        {
            if (itemSlot.itemPickUpType == pickAndMountItem)
            {
                return(itemSlot);
            }
        }

        return(null);
    }
    public bool RemoveItemInventory(PickAndMountItem item)
    {
        if (inventoryLists.Count <= 0)
        {
            toastMessage.ShowMessage("No items to remove from inventory, as it is empty!!");
            return(false);
        }

        inventoryLists.Remove(item);

        playerHUD.UpdatePlayerCollectedStats(inventoryLists.Count);

        return(true);
    }
    public bool AddItemToInventory(PickAndMountItem item)
    {
        if (inventoryLists.Count >= GameConstants.MaxInventoryList)
        {
            toastMessage.ShowMessage("Max items reached in inventory!!");
            return(false);
        }

        inventoryLists.Add(item);

        playerHUD.UpdatePlayerCollectedStats(inventoryLists.Count);

        return(true);
    }
예제 #5
0
 private void ResetSlot()
 {
     itemName = "";
     mountedItemIconGameObject = null;
     itemPickUpType            = null;
 }