using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Recipe : MonoBehaviour {
public string itemName;
public Dictionary<string, int> items;
public Recipe(string name, Dictionary<string, int> materials)
{
itemName = name;
items = materials;
Inventory.recipes.Add(this);
}
}
//////////////////////////////////////////////////////////
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class RecipeCreator : MonoBehaviour {
public RecipeCreator() {
Recipe WoodPlanks = new Recipe ("WoodPlanks", new Dictionary<string, int> (){
{"Wood", 2}
});
Recipe Knife = new Recipe ("Knife", new Dictionary<string, int> (){
{"Stick", 1}, {"Stone", 1}
});
}
}
These are my two scripts for the crafting, everything works fine except when there is more than one material for the recipe im able to craft the item even if i only have one of the items. so when im crafting the knife i only need 1 stick or 1 stone but i want it to require both. how would i do that?