Inventory is a dictionary

Inventory Networking
This commit is contained in:
Melbyj1125
2021-11-19 13:44:36 -06:00
parent 64aafcb80e
commit 3ca497b913
21 changed files with 744 additions and 85 deletions

View File

@@ -14,10 +14,19 @@ public class InventoryManager : MonoBehaviour
set{ itemList = value; }
}
//Item Dictionary
private Dictionary<string, Item> itemDict = new Dictionary<string, Item>();
public Dictionary<string, Item> ItemDict{
get{ return itemDict; }
}
void Awake(){
//Gets Items in Resource Folder
allItems = Resources.LoadAll<Item>("ItemObjects");
itemList = new List<Item>(allItems);
foreach(Item item in itemList){
itemDict.Add(item.name, item);
}
}
}