From 8b54816433e29c2f0864a4944adaa7440027b13a Mon Sep 17 00:00:00 2001 From: swrring Date: Fri, 8 May 2026 17:13:25 +0900 Subject: [PATCH] =?UTF-8?q?BT5-Dev=20#111:=20MeasureSafeWalkDistance=20?= =?UTF-8?q?=EC=9C=84=C2=B7=EC=95=84=EB=9E=98=201=20cell=20=EC=9D=B8?= =?UTF-8?q?=EC=A0=91=20=EA=B2=80=EC=83=89=20(=EC=A2=81=EC=9D=80=20?= =?UTF-8?q?=EB=B0=9C=ED=8C=90=20patrol=20=EA=B1=B0=EB=A6=AC=200=20?= =?UTF-8?q?=EC=A0=95=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PD 결정 (i)+(iii) 진행. (iii) 영역 = 이미 정합 (Level + AutoForeground 양 Tilemap 검색). (i) 적용: 근본: 좌·우 same-y cell 즉시 break → 1 cell 폭 발판·계단 영역 patrol 거리 0 정정: nextSame / nextUp / nextDown 중 어느 하나라도 HasTile = 발판 연속 PD 직전 명시 좁은 영역 Enemy 잔여 5건 정정 대상: - #6 (70.85, -6.46), #10 (17.10, 0.08), #11 (82.28, -5.71 좌측만) - #15 (60.78, 4.31 좌측만), #16 (24.49, 1.84 사실상 정지) BT110 다단 fallback (8건→1건 startTm=NULL) + BT111 위·아래 cell 인접 (좁은 영역 patrol 정합 도달) --- Assets/Scripts/Mechanics/EnemyController.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Mechanics/EnemyController.cs b/Assets/Scripts/Mechanics/EnemyController.cs index 97b32c1..02dc5fb 100644 --- a/Assets/Scripts/Mechanics/EnemyController.cs +++ b/Assets/Scripts/Mechanics/EnemyController.cs @@ -197,13 +197,21 @@ namespace Platformer.Mechanics if (startTm == null) return 0f; // 좌·우 연속 Tile 영역 끝 영역 검색 + // BT111 (2026-05-08) — 위·아래 1 cell 인접 cell도 검색 (계단 영역 발판 연속 정합) + // PD 보고: 좁은 영역 1 cell 폭 발판 위 Enemy patrol 거리 0 + // 근본: 좌·우 same-y cell 즉시 break → 계단·1 cell 폭 영역 발판 연속 미감지 + // 정정: 다음 same-y / +1 / -1 중 어느 곳이라도 HasTile = 발판 연속 int dirCell = (int)Mathf.Sign(dir); Vector3Int cellIter = startCell; for (int steps = 0; steps < 500; steps++) { - Vector3Int nextCell = cellIter + new Vector3Int(dirCell, 0, 0); - if (!HasTileInAnyTilemap(groundTilemaps, nextCell)) break; - cellIter = nextCell; + Vector3Int nextSame = cellIter + new Vector3Int(dirCell, 0, 0); + Vector3Int nextUp = nextSame + Vector3Int.up; + Vector3Int nextDown = nextSame + Vector3Int.down; + if (HasTileInAnyTilemap(groundTilemaps, nextSame)) cellIter = nextSame; + else if (HasTileInAnyTilemap(groundTilemaps, nextUp)) cellIter = nextUp; + else if (HasTileInAnyTilemap(groundTilemaps, nextDown)) cellIter = nextDown; + else break; } // 마지막 Tile cell 영역 center 영역까지 거리