Hi, guys, how are you?
I’m a bit in trouble, and I assume I was stuck in it a few days, so I decided to ask for help.
I’m doing a craft system where the player pushes a button to make the new item, in that item he has an array of items that is the price to craft, ie a shovel would need (wood and stone).
My code works partially, but I need to verify that the player has the 2 items in his inventory, in which case he only checks one item.
Would anyone have any suggestions on how to improve this system?
thank you in advance, any and all help.
Prints
Cost of the item, there are 2 linked items and the intention is to compare if it has these 2 items in the inventory.
Void CheckHaveItem(){
for (int i = 0; i < itemToSlot.cost.Length; i++)
{
var checkInventory = buildItems.inventory.slot.Where(x => x.itemToSlot != null).Where(x => x.itemToSlot.Id == itemToSlot.cost[i].Id);
foreach (var item in checkInventory)
{
//Enable and disable button craft
}
}
}