mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Gate created and player tagged correctly
This commit is contained in:
32
Assets/Scripts/PlayerScripts/PlayerItems/InventoryManager.cs
Normal file
32
Assets/Scripts/PlayerScripts/PlayerItems/InventoryManager.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class InventoryManager : MonoBehaviour
|
||||
{
|
||||
//allItems array
|
||||
public Item[] allItems;
|
||||
|
||||
//Item list
|
||||
private List<Item> itemList;
|
||||
public List<Item> ItemList{
|
||||
get{ return itemList; }
|
||||
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