RiftMayhem/Assets/Scripts/Items/InventoryData.cs
Pedro Gomes 5ce9c0b3a7 Bugfixes + Weapon Visual handler
- bugfix build manager on starter builds not correctly assigning keybinders with defaults
- added 2h ranged shoot animation
- added shoot animation type for abilities
- new weapon visual handler swaps visual weapons based on ability queues
2025-01-13 20:48:15 +00:00

58 lines
1.4 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEditor;
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;
}
}
}