RiftMayhem/Assets/Scripts/Items/InventoryData.cs
Pedro Gomes 4c3edff503 Crafting system working (WIP)
- Crafting UI fully functional
- Crafting Stat stones and modular equippable items fully functional
Notes:
- Urgent need for exclusive(auto sorted) inventory for stones only
- Something to do with the "trash" modular items instead of just selling
- Add new uses for gold besides equipment, preset items will probably be worthless with modular crafting
2025-01-06 19:52:31 +00:00

56 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class InventoryData
{
public int[] inventoryItems;
public InventoryData()
{
inventoryItems = new int[GameConstants.Sizes.TotalInventorySlots];
for (int i = 0; i < inventoryItems.Length; i++)
{
inventoryItems[i] = -1;
}
}
public InventoryData(int[] inventoryItems)
{
this.inventoryItems = new int[GameConstants.Sizes.TotalInventorySlots];
for (int i = 0; i < inventoryItems.Length; i++)
{
this.inventoryItems[i] = inventoryItems[i];
}
}
}
[System.Serializable]
public class InventoryInstanceData
{
[SerializeReference]
public ItemInstance[] inventoryItems;
public InventoryInstanceData()
{
inventoryItems = new ItemInstance[GameConstants.Sizes.TotalInventorySlots];
for (int i = 0; i < inventoryItems.Length; i++)
{
inventoryItems[i] = null;
}
}
public InventoryInstanceData(ItemInstance[] inventoryItems)
{
this.inventoryItems = new ItemInstance[GameConstants.Sizes.TotalInventorySlots];
for (int i = 0; i < inventoryItems.Length; i++)
{
this.inventoryItems[i] = inventoryItems[i];
this.inventoryItems[i].Icon = ItemIndexer.Instance.Items[this.inventoryItems[i].templateIndex].Icon;
}
}
}