2026-04-03 상호작용 버그 수정

This commit is contained in:
2026-04-03 11:34:25 +09:00
parent 7e19e4f248
commit 78e0f1a5b6
5 changed files with 47 additions and 17 deletions

View File

@@ -353,6 +353,7 @@ public void SpawnItemToWorld(ItemInstance dropItem)
// 빈 게임오브젝트를 생성하고 WorldItem 컴포넌트를 붙임
GameObject dropObj = new GameObject($"{dropItem.Data.ItemName}_Dropped");
dropObj.transform.SetParent(GameManager.Instance.DynamicObjectsField.transform);
dropObj.transform.position = dropPosition;
WorldItem worldItem = dropObj.AddComponent<WorldItem>();
@@ -371,4 +372,17 @@ public void DropItemFromSlot(int slotIndex)
UpdateUI();
}
public void ItemUse(int slotIndex)
{
GameManager.Instance.ItemEffect.ItemUse(Items[slotIndex]);
Items[slotIndex].CurrentStack -= 1;
if (Items[slotIndex].CurrentStack <= 0)
{
Slots[slotIndex].ClearSlot();
Items[slotIndex] = null;
}
UpdateUI();
}
}