diff --git a/Assets/Scripts/Mechanics/PlayerController.cs b/Assets/Scripts/Mechanics/PlayerController.cs index cbfccdc..5fc89c7 100644 --- a/Assets/Scripts/Mechanics/PlayerController.cs +++ b/Assets/Scripts/Mechanics/PlayerController.cs @@ -41,6 +41,11 @@ namespace Platformer.Mechanics public JumpState jumpState = JumpState.Grounded; private bool stopJump; + + // BT69 — Down + Jump Drop-Through (PD 명시 2026-05-08): Down 누른 상태에서 점프 시 발판 통과 + 점프 모션 + private float dropThroughTimer = 0f; // 활성 시간 동안 Layer 16 mask 강제 OFF + private const float DROP_THROUGH_DURATION = 0.3f; // Drop-Through 활성 지속 시간 (초) + private bool dropThroughJump = false; // 본 frame Drop-Through 점프 발동 여부 (velocity.y 처리 분기) /*internal new*/ public Collider2D collider2d; /*internal new*/ public AudioSource audioSource; public Health health; @@ -136,9 +141,19 @@ namespace Platformer.Mechanics { if (controlEnabled) { - move.x = m_MoveAction.ReadValue().x; + Vector2 moveInput = m_MoveAction.ReadValue(); + move.x = moveInput.x; if (jumpState == JumpState.Grounded && m_JumpAction.WasPressedThisFrame()) + { + // BT69 — Down + Jump = Drop-Through (PD 명시 2026-05-08) + bool downHeld = moveInput.y < -0.5f; + if (downHeld) + { + dropThroughTimer = DROP_THROUGH_DURATION; + dropThroughJump = true; + } jumpState = JumpState.PrepareToJump; + } else if (m_JumpAction.WasReleasedThisFrame()) { stopJump = true; @@ -150,6 +165,9 @@ namespace Platformer.Mechanics { move.x = 0; } + + // BT69 — Drop-Through Timer 감소 (Layer 16 mask 강제 OFF 지속 시간) + if (dropThroughTimer > 0f) dropThroughTimer -= Time.deltaTime; UpdateJumpState(); base.Update(); @@ -205,8 +223,10 @@ namespace Platformer.Mechanics int baseMask = Physics2D.GetLayerCollisionMask(gameObject.layer); // BT5-Dev #43 — IsGrounded 영역 폐기 (frame 0 미설정 → 떨어짐). footHit 단독 + 점프 영역 OFF 강제 + // BT69 — Drop-Through Timer 활성 시 Layer 16 mask 강제 OFF (Down + Jump 입력 발판 통과) bool isJumpingThrough = jumpState == JumpState.Jumping - || (jumpState == JumpState.InFlight && velocity.y > 0.01f); + || (jumpState == JumpState.InFlight && velocity.y > 0.01f) + || dropThroughTimer > 0f; bool standingOnPlatform = false; if (collider2d != null && !isJumpingThrough) @@ -227,7 +247,16 @@ namespace Platformer.Mechanics { if (jump && IsGrounded) { - velocity.y = jumpTakeOffSpeed * model.jumpModifier; + // BT69 — Drop-Through 점프 분기: Down + Jump 입력 시 위로 점프 X (gravity로 떨어짐 + 점프 모션만 유지) + if (dropThroughJump) + { + velocity.y = 0f; // 위 속도 X — 발판 통과 후 자연 낙하 + dropThroughJump = false; + } + else + { + velocity.y = jumpTakeOffSpeed * model.jumpModifier; + } jump = false; } else if (stopJump)