fix(BT12-Dev): Player 피격 — Bounds.Intersects → 2D AABB (Z 무시)

PD: "지시 수정 정합 X·변화 X"

근본 (MCP Play 직접 실측·자성 #13):
- Enemy 강제 Player 위치 이동 후에도 Intersects=False
- Bounds 분석:
  - Enemy z=0 (Variant prefab default)
  - Player z=1 (Scene 영역)
  - Bounds.Intersects는 3D 비교 → Z 1 unit 차이로 항상 false

fix:
- Bounds.Intersects 폐기·2D AABB 직접 검사
- Mathf.Abs(deltaX) < (eExtents.x + pExtents.x) && deltaY 동일
- Z 좌표 무시·2D 게임 정합

회귀 영역 X:
- IsGrounded 조건·cliffCheck·KinematicObject·VisualBounds 영역 영역 X
- 영역 1 (cliffCheck 매 frame) 정합 유지

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
깃 관리자 2026-05-12 16:55:06 +09:00
parent e3e4f97a6f
commit da6e694d5c
1 changed files with 6 additions and 1 deletions

View File

@ -384,7 +384,12 @@ namespace Platformer.Mechanics
}
if (_cachedPlayer != null && _cachedPlayer.health != null && _cachedPlayer.health.IsAlive)
{
if (_cachedPlayer.IsGrounded && VisualBounds.Intersects(_cachedPlayer.Bounds))
// BT12-Dev 2026-05-12 — 2D AABB 검사 (Z 무시: Enemy z=0·Player z=1·Bounds.Intersects 3D 비교 항상 False).
var eb = VisualBounds;
var pb = _cachedPlayer.Bounds;
bool overlap2D = Mathf.Abs(eb.center.x - pb.center.x) < (eb.extents.x + pb.extents.x)
&& Mathf.Abs(eb.center.y - pb.center.y) < (eb.extents.y + pb.extents.y);
if (_cachedPlayer.IsGrounded && overlap2D)
{
if (!_cachedPlayer.health.IsInvulnerable)
{