mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-07 01:45:17 -05:00
Inventory is a dictionary
Inventory Networking
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user