2026-05-20 공격방향전환
This commit is contained in:
@@ -272,9 +272,16 @@ private void ExecuteBufferedInputIfReady()
|
||||
if (_attackCooldownTimer > 0f || !_pendingInput.HasValue) return;
|
||||
|
||||
ComboInputType buffered = _pendingInput.Value;
|
||||
bool stillValid = Time.time - _pendingInputTime <= _bufferLifetime;
|
||||
bool expired = Time.time - _pendingInputTime > _bufferLifetime;
|
||||
|
||||
// 진행 중인 공격을 "콤보 연계 없이" 캔슬하는 입력이면 아직 발화하지 않고,
|
||||
// 그 공격이 끝날 때까지 버퍼에 남겨둔다 (마지막 공격 등이 캔슬되지 않게).
|
||||
// 단, 수명이 지난 입력은 폐기.
|
||||
if (!expired && _isAttackActive && !CanTransitionFromCurrentNode(buffered))
|
||||
return;
|
||||
|
||||
_pendingInput = null;
|
||||
if (stillValid)
|
||||
if (!expired)
|
||||
ExecuteComboInput(buffered);
|
||||
}
|
||||
|
||||
@@ -350,10 +357,15 @@ private void OnGrabSmashInput()
|
||||
// 3) 그 외에는 즉시 ExecuteComboInput으로 발화
|
||||
private void HandleComboInput(ComboInputType input)
|
||||
{
|
||||
if (_isMotionActive && !CanTransitionFromCurrentNode(input))
|
||||
// 콤보 연계(현재 노드의 트랜지션) 가능 여부 — 연계는 애니메이션 중에도 즉시 캔슬-체인.
|
||||
bool canChain = CanTransitionFromCurrentNode(input);
|
||||
|
||||
if (_isMotionActive && !canChain)
|
||||
return;
|
||||
|
||||
if (_attackCooldownTimer > 0f)
|
||||
// 쿨다운 중이거나, 진행 중인 공격을 "콤보 연계 없이" 끊으려는 입력이면 버퍼링.
|
||||
// (마지막 공격처럼 다음 콤보가 없는 입력이 애니메이션을 캔슬하던 문제 방지)
|
||||
if (_attackCooldownTimer > 0f || (_isAttackActive && !canChain))
|
||||
{
|
||||
float elapsed = Time.time - _attackStartTime;
|
||||
// _bufferOpenTime 전엔 너무 일찍 누른 입력으로 간주하고 무시.
|
||||
@@ -370,6 +382,10 @@ private void HandleComboInput(ComboInputType input)
|
||||
|
||||
private void ExecuteComboInput(ComboInputType input)
|
||||
{
|
||||
// 좌우 방향키를 누르고 있으면 그쪽으로 페이싱 전환 후 공격.
|
||||
// (콤보 중 facing이 잠겨 있어도 다음 콤보는 누른 방향으로 나간다.)
|
||||
UpdateFacingFromMoveInput();
|
||||
|
||||
// 콤보 입력 가능 시간이 열려 있으면 현재 노드에서 다음 연계로 이어간다.
|
||||
if (_comboWindowTimer > 0f && _currentNode != null)
|
||||
{
|
||||
@@ -412,16 +428,14 @@ private void ExecuteComboInput(ComboInputType input)
|
||||
}
|
||||
|
||||
// 현재 방향키 입력을 공격 방향(AttackDirection)으로 변환.
|
||||
// 좌우 입력은 ExecuteComboInput에서 누른 쪽으로 페이싱을 돌리므로 항상 Forward.
|
||||
// 대각선 입력은 위/아래를 우선한다 (점프 견제·다운 어택을 우선).
|
||||
// 좌우는 페이싱 기준으로 Forward(앞)/Back(뒤)로 구분.
|
||||
private AttackDirection GetAttackDirection()
|
||||
{
|
||||
if (_moveInputY > 0f) return AttackDirection.Up;
|
||||
if (_moveInputY < 0f) return AttackDirection.Down;
|
||||
if (_moveInputX == 0f) return AttackDirection.Neutral;
|
||||
|
||||
float facing = _spriteRenderer != null && _spriteRenderer.flipX ? -1f : 1f;
|
||||
return Mathf.Sign(_moveInputX) == facing ? AttackDirection.Forward : AttackDirection.Back;
|
||||
if (_moveInputX != 0f) return AttackDirection.Forward;
|
||||
return AttackDirection.Neutral;
|
||||
}
|
||||
|
||||
// 노드의 방향별 변형 중 현재 입력 방향과 일치하는 액션을 선택.
|
||||
|
||||
Reference in New Issue
Block a user