Ok, so I coded a basic item, craft, and inventory script.
Here.
public class Inventory : MonoBehavior{
public List<Item> MyItems = new List<Item>();
void Craft(CraftRecipe r){
//Check if the items in MyItems contains r.InputItems
bool b = CheckItems(r.InputItems);
if(b){
//I will write some code here later(I would not need help with destroying used items or adding the Output item)
}
}
public bool CheckItems(List<Item> check){
//Check if MyItems contains check, and if so return true, else return false.
}
}
public class Item{
public string MyName;
public string MyValue;
}
public class CraftRecipe{
public List<Item> InputItems = new List<Item>();
public Item Output;
}
Here’s the problem, how do I check if I have the Recipe’s input items in the inventory(I know I will use the CheckItems, but I do not know how to check if MyItems contains check), I do not use Linq, so anything using it would be nice if its explained.
Thanks!