2026-03-28 인벤토리 90%
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user