Here is the code in question:
public List<Item> craftingItems = new List<Item>();
public void checkIfItemIsCraftable(){
for (int i = 0; i < inv.database.craftingDatabase.Count; i++) {
for (int x = 0; i < craftingItems.Count; x++) {
if (craftingItems [x].ID == inv.database.craftingDatabase <em>["craft"] ["itemID_1"] || craftingItems [x].ID == inv.database.craftingDatabase *["craft"] ["itemID_2"]) {*</em>
if (craftingItems .ID == inv.database.craftingDatabase [“craft”] [“itemID_1”] || craftingItems .ID == inv.database.craftingDatabase [“craft”] [“itemID_2”]) {
_ Debug.Log (inv.database.craftingDatabase .Name);_
* }*
* }*
* }*
* }*
* }*
Very sloppy I know but its because I’m just trying to figure something out. I am these errors:
> Assets/Scripts/ItemCrafting.cs(40,68):
> error CS0021: Cannot apply indexing
> with [] to an expression of type
> `Item’.
>
> Assets/Scripts/ItemCrafting.cs(41,67):
> error CS0021: Cannot apply indexing
> with [] to an expression of type
> `Item’.
I have looped through many variations of the the same type of List before but for some reason this one will not work. I have no idea if I am overlooking something but its gotten to the point were I just can’t figure it out. If someone could shine some light on this I would greatly appreciate it!
Thank you.