2026-04-03 상호작용 버그 수정
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user