InputActionPhase
- Started: 실행 시작 시 호출 (버튼 눌렀을 때)
- Performed: 실행 확정 시 호출 (버튼 눌렀을 때, Started 뒤에 실행)
- Canceled: 실행 종료 시 호출 ( 버튼 뗐을 때)
- Disabled: 액션이 활성화되지 않음
- Waiting: 액션이 활성화되어있고 입력을 기다리는 상태
예시
public void OnMoveInput(InputAction.CallbackContext context)
{
if (context.phase == InputActionPhase.Performed) // 버튼 눌렀을 때
{
_curMovementInput = context.ReadValue<Vector2>();
}
else if (context.phase == InputActionPhase.Canceled) // 버튼 뗐을 때
{
_curMovementInput = Vector2.zero;
}
}
'유니티' 카테고리의 다른 글
범위 내 콜라이더 판별 (OverlapSphere) (0) | 2024.01.17 |
---|---|
콤보 공격 구현 (0) | 2024.01.11 |
3D 애니메이션 만들기 (믹사모) (0) | 2024.01.09 |
3D 총기 구현 (2) (1) | 2024.01.05 |
Rotation 값 변경 (1) | 2024.01.03 |