2026-04-13 스킬,퀵슬롯 시스템 수정중

This commit is contained in:
2026-04-13 18:04:55 +09:00
parent de0ba90953
commit 71a6fda0da
57 changed files with 9074 additions and 59 deletions

View File

@@ -385,4 +385,31 @@ public void ItemUse(int slotIndex)
}
UpdateUI();
}
// 퀵슬롯 동기화용: 해당 아이템 데이터의 총 보유량 합산 (0이면 퀵슬롯에서 자동 해제)
public int GetTotalStack(Item itemData)
{
if (itemData == null) return 0;
int total = 0;
for (int i = 0; i < Items.Length; i++)
{
if (Items[i] != null && Items[i].Data == itemData)
total += Items[i].CurrentStack;
}
return total;
}
// 퀵슬롯에서 아이템 사용 시 호출: 해당 데이터가 담긴 가장 앞 슬롯을 사용
public void UseItemByData(Item itemData)
{
if (itemData == null) return;
for (int i = 0; i < Items.Length; i++)
{
if (Items[i] != null && Items[i].Data == itemData)
{
ItemUse(i);
return;
}
}
}
}