// Use this for initialization void Start() { myHotbar = hotbar.GetComponent <ItemBar>(); myInventory = inventory.GetComponent <InventoryScreen>(); myLoadout = loadoutPrefab.GetComponent <Loadout>(); int i = 0; foreach (GameObject obj in myLoadout.GetHotbar()) { myHotbar.AddItemAtSpot(obj, "h" + i); i++; } i = 0; foreach (GameObject obj in myLoadout.GetInventory()) { myInventory.AddItemAtSpot(obj, "i" + i); i++; } }
public void SetInventory(Loadout currentInventory) { inventory = currentInventory.GetInventory(); }