2026-03-17 14:19 FPS시점의 Strafe캐릭터 조작과 에임모드 전환
This commit is contained in:
@@ -20,9 +20,12 @@ public class InputManager : MonoBehaviour
|
||||
public event Action<Vector2> OnMoveEvent;
|
||||
public event Action<InputState> OnSprintEvent;
|
||||
public event Action<InputState> OnJumpEvent;
|
||||
public event Action<InputState> OnAimToggleEvent;
|
||||
public event Action<Vector2> OnLookEvent;
|
||||
public event Action OnNormalAttackEvent;
|
||||
public event Action OnHeavyAttackEvent;
|
||||
|
||||
|
||||
//키조작
|
||||
public event Action OnKeyDown_UpArrowEvent;
|
||||
public event Action OnKeyDown_DownArrowEvent;
|
||||
@@ -95,8 +98,11 @@ public void SetCharacterInputMap(string mapName)
|
||||
BindActionCharacter("Move", OnMove);
|
||||
BindActionCharacter("Sprint", OnSprint);
|
||||
BindActionCharacter("Jump", OnJump);
|
||||
BindActionCharacter("AimToggle", OnAimToggle);
|
||||
BindActionCharacter("Look", OnLook);
|
||||
BindActionCharacter("NormalAttack", OnNormalAttack);
|
||||
BindActionCharacter("HeavyAttack", OnHeavyAttack);
|
||||
|
||||
}
|
||||
|
||||
//매핑용 함수
|
||||
@@ -171,7 +177,18 @@ private void OnJump(InputAction.CallbackContext ctx)
|
||||
OnJumpEvent?.Invoke(InputState.Canceled);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnAimToggle(InputAction.CallbackContext ctx)
|
||||
{
|
||||
if (ctx.started)
|
||||
{
|
||||
OnAimToggleEvent?.Invoke(InputState.Started);
|
||||
}
|
||||
}
|
||||
private void OnLook(InputAction.CallbackContext ctx)
|
||||
{
|
||||
Vector2 look = ctx.ReadValue<Vector2>();
|
||||
OnLookEvent?.Invoke(look);
|
||||
}
|
||||
private void OnNormalAttack(InputAction.CallbackContext ctx)
|
||||
{
|
||||
OnNormalAttackEvent?.Invoke();
|
||||
@@ -193,7 +210,7 @@ private void OnKeyDown_UpArrow(InputAction.CallbackContext ctx)
|
||||
private void OnKeyDown_DownArrow(InputAction.CallbackContext ctx)
|
||||
{
|
||||
if (ctx.started)
|
||||
OnKeyDown_UpArrowEvent?.Invoke();
|
||||
OnKeyDown_DownArrowEvent?.Invoke();
|
||||
}
|
||||
|
||||
private void OnKeyDown_Enter(InputAction.CallbackContext ctx)
|
||||
|
||||
Reference in New Issue
Block a user