(client) feat:实现掉落物,UI显示,维度

This commit is contained in:
m0_75251201
2025-08-27 13:56:22 +08:00
parent f04c89046b
commit 0c99e2beee
46 changed files with 6150 additions and 1809 deletions

View File

@ -142,6 +142,25 @@ namespace Entity
{
return _slots.AsReadOnly();
}
public InventorySlot GetSlot(Item.ItemResource itemResource)
{
if (itemResource == null) return null;
foreach (var slot in _slots)
{
if (slot.Item != null && slot.Item.DefName == itemResource.DefName)
{
return slot;
}
}
return null;
}
public InventorySlot GetSlot(int i)
{
i = Mathf.Clamp(i, 0, Capacity - 1);
return _slots[i];
}
public int OccupiedSlotsCount => _slots.Count;
public int AvailableSlotsCount => Capacity - _slots.Count;