diff --git a/Assets/Scripts/Mechanics/GameOptimizer.cs b/Assets/Scripts/Mechanics/GameOptimizer.cs index b24e528..a0dafd3 100644 --- a/Assets/Scripts/Mechanics/GameOptimizer.cs +++ b/Assets/Scripts/Mechanics/GameOptimizer.cs @@ -171,12 +171,19 @@ namespace Platformer.Mechanics if (wallParent == null) wallParent = new GameObject("CliffWalls"); int wallCount = 0; + + // BT100 — 자체 가장자리 검사 = Level + AutoForeground 만 (PD Foreground = 시각 가림막·통로 영역 차단 X) + var checkTilemaps = new System.Collections.Generic.List(); + if (levelTm != null) checkTilemaps.Add(levelTm); + if (autoFgTm != null) checkTilemaps.Add(autoFgTm); + + // 인접 검사 = Level + AutoForeground + PD Foreground 모두 (안전 영역 모두 포함) var allTilemaps = new System.Collections.Generic.List(); if (levelTm != null) allTilemaps.Add(levelTm); if (autoFgTm != null) allTilemaps.Add(autoFgTm); if (pdFgTm != null) allTilemaps.Add(pdFgTm); - foreach (var tm in allTilemaps) + foreach (var tm in checkTilemaps) { var bounds = tm.cellBounds; for (int x = bounds.xMin; x <= bounds.xMax; x++) @@ -220,8 +227,9 @@ namespace Platformer.Mechanics wall.transform.position = worldPos; wall.layer = 18; // EnemyWall var box = wall.AddComponent(); - box.size = new Vector2(0.1f, 3f); // 좁고 높은 영역 - box.offset = new Vector2(0f, 1f); // Tile 위 영역 차단 (지면 위 1.5m) + // BT100 — size·offset 정정: 매우 좁은 영역(0.02) + Tile 표면 영역(offset.y=0)·절벽 위치 정확 + box.size = new Vector2(0.02f, 3f); + box.offset = new Vector2(0f, 0f); } ///