mirror of
https://github.com/DerTyp7/harvestdale-unity.git
synced 2025-10-29 20:52:10 +01:00
draggable items
This commit is contained in:
@@ -25,7 +25,9 @@ public class InventoryUI : MonoBehaviour
|
||||
|
||||
for (int i = 0; i < playerInventory.maxSlots; i++)
|
||||
{
|
||||
slotUIList.Add(Instantiate(slotPrefab, Vector3.zero, Quaternion.identity, slotListObj.transform).GetComponent<SlotUI>());
|
||||
SlotUI newSlot = Instantiate(slotPrefab, Vector3.zero, Quaternion.identity, slotListObj.transform).GetComponent<SlotUI>();
|
||||
newSlot.slotIndex = i;
|
||||
slotUIList.Add(newSlot);
|
||||
}
|
||||
}
|
||||
private void UpdateSlots()
|
||||
@@ -34,14 +36,9 @@ public class InventoryUI : MonoBehaviour
|
||||
int i = 0;
|
||||
foreach (SlotUI slotUi in slotUIList)
|
||||
{
|
||||
if (i < playerInventory.items.Count)
|
||||
{
|
||||
slotUi.SetInventoryItem(playerInventory.items[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
slotUi.SetInventoryItem(null);
|
||||
}
|
||||
|
||||
slotUi.SetInventoryItem(playerInventory.items[i]);
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user