2026-03-28 인벤토리 90%

This commit is contained in:
2026-03-28 15:31:27 +09:00
parent 2050772614
commit 7fe45db079
290 changed files with 18921 additions and 250 deletions

View File

@@ -14,10 +14,6 @@ public class WorldItem : MonoBehaviour
private float _bounceFrequency; // 오르내리는 속도
private Vector3 _startPos;
[Header("Only Test")]
[SerializeField] private Item _testField_OriginItem;
[SerializeField] private int _testField_ItemStack = 1;
private void Awake()
{
_boxCollider = GetComponent<BoxCollider>();
@@ -27,13 +23,6 @@ private void Awake()
private void Start()
{
//테스트용
if (ItemInstance == null || ItemInstance.Data == null)
{
ItemInstance Item = new ItemInstance(_testField_OriginItem, _testField_ItemStack);
SetItem(Item);
}
_rotationSpeed = GameManager.Instance.ItemRotationSpeed;
_bounceAmplitude = GameManager.Instance.ItemBounceAmplitude;
_bounceFrequency = GameManager.Instance.ItemBounceFrequency;

View File

@@ -31,8 +31,9 @@ public class InputManager : MonoBehaviour
public event Action OnKeyDown_UpArrowEvent;
public event Action OnKeyDown_DownArrowEvent;
public event Action OnKeyDown_EnterEvent;
public event Action OnKeyDown_IKeyEvent;
private void Awake()
{
if (Instance == null)
@@ -76,13 +77,13 @@ public void SetUIInputMap(string mapName)
_uiInputActionMap = _playerInput?.actions?.FindActionMap(mapName);
if (_uiInputActionMap == null) return;
// 맵 활성화
_uiInputActionMap.Enable();
//바인딩
BindActionUI("OnKeyDown_UpArrow", OnKeyDown_UpArrow);
BindActionUI("OnKeyDown_DownArrow", OnKeyDown_DownArrow);
BindActionUI("OnKeyDown_Enter", OnKeyDown_Enter);
BindActionUI("OnkeyDown_IKey", OnKeyDown_IKey);
_uiInputActionMap.Disable();
}
@@ -91,9 +92,6 @@ public void SetCharacterInputMap(string mapName)
_characterInputActionMap = _playerInput?.actions?.FindActionMap(mapName);
if (_characterInputActionMap == null) return;
// 맵 활성화
_characterInputActionMap.Enable();
//바인딩
BindActionCharacter("Scroll", OnMouseScroll);
BindActionCharacter("Move", OnMove);
@@ -104,6 +102,9 @@ public void SetCharacterInputMap(string mapName)
BindActionCharacter("Dodge", OnDodge);
BindActionCharacter("NormalAttack", OnNormalAttack);
BindActionCharacter("HeavyAttack", OnHeavyAttack);
BindActionCharacter("OnkeyDown_IKey", OnKeyDown_IKey);
_characterInputActionMap.Disable();
}
@@ -120,8 +121,6 @@ private void BindActionUI(string actionName, Action<InputAction.CallbackContext>
action.performed += callback;
action.canceled += callback;
action.started += callback;
action.Enable();
}
}
private void BindActionCharacter(string actionName, Action<InputAction.CallbackContext> callback)
@@ -136,11 +135,14 @@ private void BindActionCharacter(string actionName, Action<InputAction.CallbackC
action.performed += callback;
action.canceled += callback;
action.started += callback;
action.Enable();
}
}
public void ActiveOnlyOneActionMap(string actionMapName)
{
_playerInput.SwitchCurrentActionMap(actionMapName);
}
#region
private void OnMouseScroll(InputAction.CallbackContext ctx)
{
@@ -229,5 +231,11 @@ private void OnKeyDown_Enter(InputAction.CallbackContext ctx)
if (ctx.started)
OnKeyDown_EnterEvent?.Invoke();
}
private void OnKeyDown_IKey(InputAction.CallbackContext ctx)
{
if(ctx.started)
OnKeyDown_IKeyEvent?.Invoke();
}
#endregion
}

View File

@@ -6,7 +6,6 @@
public class InventoryManager : MonoBehaviour
{
[SerializeField] private GameObject _inventoryRoot;
[SerializeField] private GameObject _inventoryContentRoot;
[SerializeField] private GameObject _slotPrefab;
@@ -51,21 +50,6 @@ private void Start()
{
}
public void InventoryToggle()
{
if (_inventoryRoot != null)
{
InventoryOnOff(!_inventoryRoot.activeSelf);
}
}
public void InventoryOnOff(bool onOff)
{
if (_inventoryRoot != null)
{
_inventoryRoot.SetActive(onOff);
}
}
public void UpdateUI()
{

View File

@@ -95,6 +95,9 @@ public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
InputManager.Instance.SetUIInputMap("InGameUI");
InputManager.Instance.SetCharacterInputMap("Character");
//일단 하나의 액션맵만 사용
InputManager.Instance.ActiveOnlyOneActionMap("Character");
//카메라 줌 매핑
InputManager.Instance.OnMouseScrollEvent += GameManager.Instance.Camera.ZoomCamera;
@@ -108,6 +111,9 @@ public void OnSceneLoaded(Scene scene, LoadSceneMode mode)
//InputManager.Instance.OnNormalAttackEvent;
//InputManager.Instance.OnHeavyAttackEvent;
//UI매핑
InputManager.Instance.OnKeyDown_IKeyEvent += GameManager.Instance.InGameUI.InventoryToggle;
//화면 켜기
}
@@ -141,9 +147,17 @@ private void OnDestroy()
InputManager.Instance.OnMoveEvent -= CurrentCharacterController.MoveInput;
InputManager.Instance.OnSprintEvent -= CurrentCharacterController.SprintInput;
InputManager.Instance.OnJumpEvent -= CurrentCharacterController.JumpInput;
InputManager.Instance.OnAimToggleEvent -= CurrentCharacterController.AimToggleInput;
InputManager.Instance.OnLookEvent -= CurrentCharacterController.LookInput;
InputManager.Instance.OnDodgeEvent -= CurrentCharacterController.DodgeInput;
//InputManager.Instance.OnNormalAttackEvent;
//InputManager.Instance.OnHeavyAttackEvent;
}
if(GameManager.Instance != null)
{
InputManager.Instance.OnKeyDown_IKeyEvent -= GameManager.Instance.InGameUI.InventoryToggle;
}
}
}
}

View File

@@ -1,15 +1,15 @@
using UnityEngine;
using UnityEngine.InputSystem;
public class InGameUIManager : BaseUIManager
{
public SplitWindowUI SplitWindowUI;
public TooltipUI TooltipUI;
public Transform DragCanvas;
public GameObject InventoryRoot;
[SerializeField] private GameObject _crosshairRoot;
public void VisibleCrossHair(bool isOn)
{
_crosshairRoot.SetActive(isOn);
@@ -19,4 +19,33 @@ public SplitWindowUI GetSplitWindowUI()
{
return SplitWindowUI;
}
public void InventoryToggle()
{
InventoryOnOff(!InventoryRoot.activeSelf);
}
public void InventoryOnOff(bool isOn)
{
InventoryRoot.SetActive(isOn);
if (isOn)
{
// UI 조작 모드로 변경 (캐릭터 이동 입력 차단)
InputManager.Instance.ActiveOnlyOneActionMap("InGameUI");
// 커서 자유롭게 풀기
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
}
else
{
// 플레이어 모드로 복귀
InputManager.Instance.ActiveOnlyOneActionMap("Character");
// 커서 중앙 고정 및 숨김
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
}
}
}

View File

@@ -33,6 +33,13 @@ private void Awake()
ClearSlot();
}
private void Start()
{
if (currentItem != null)
SetItem(currentItem);
}
// 아이템 데이터 설정 및 UI 갱신
public void SetItem(ItemInstance newItem)
{
@@ -73,6 +80,8 @@ public void OnDrop(PointerEventData eventData)
}
public void OnPointerEnter(PointerEventData eventData)
{
Debug.Log("PointerEnter");
if (currentItem != null && currentItem.Data != null)
{
// 드래그 중에는 툴팁 안띄움