BT5-Dev #111: MeasureSafeWalkDistance 위·아래 1 cell 인접 검색 (좁은 발판 patrol 거리 0 정정)
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 정합 도달)
This commit is contained in:
parent
19e00d3743
commit
8b54816433
|
|
@ -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 영역까지 거리
|
||||
|
|
|
|||
Loading…
Reference in New Issue