hello all I’m currently working on a cooking game were in order for an ingredient to be made it needs the proper ingredients i have the required materials to be listed via an array for enums.
EX: public FoodType FoodMaterialsNeeded;
but when I do the purchase script its unable to find the enum values in the array and only goes to the first 2 values if I put two. I’m trying to get the bool script to work but it doesn’t seem to want to work
the script in question:
public bool CanPruchase(FoodSelectionInfoReader FoodSelected)
{
for (int i = 0; i < FoodSelected.FoodInfo.FoodMaterialsNeeded.Length; i++)
{
FoodType foodvar;
foodvar =
FoodSelected.FoodInfo.FoodMaterialsNeeded*;*
int foodorder = (int)foodvar;
if (FoodSelection.FoodInfo.Cost <= comparableResourceValue[foodorder])
{
return true;
}
}
return false;
}
any Ideas on how I can get it to work the way I want it to?