2026-04-03 상호작용 버그 수정
This commit is contained in:
@@ -26,6 +26,8 @@ public class GameManager : MonoBehaviour
|
||||
public float ItemBounceFrequency = 2f; // 오르내리는 속도
|
||||
|
||||
[Header("Global Refer")]
|
||||
public GameObject StaticObjectsField;
|
||||
public GameObject DynamicObjectsField;
|
||||
public HighlightProfile InteractionHighlightProfile;
|
||||
|
||||
private void Awake()
|
||||
|
||||
@@ -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