BT5-Dev #101: PD Foreground TilemapCollider 제거·인접 검사 PD FG X (PD 2건)

PD 보고 (2026-05-08):
1. 숨겨진 통로 Player 통과 X (이전엔 문제 X)
2. 투명벽 위치 이상

진단:
- 1: BT82 영역 PD Foreground TilemapCollider 부착 = 통로 영역 충돌
- 2: BT100 인접 검사 = PD Foreground 포함 → PD FG 영역 옆 = cliff X 인식 → 실제 절벽 영역 투명벽 X 생성

정정 (BT101):
1. PD Foreground TilemapCollider Object.Destroy (BT66 R2 영역 회복·BT82 부착 영역 폐기)
   - Enemy 절벽 차단 = BT99 투명벽 영역 (Layer 18)으로 분리됨 → PD Foreground = 시각만 영역 회복 가능
   - 숨겨진 통로 영역 Player 자유 통과
2. 인접 검사 = Level + AutoForeground 만 (PD Foreground 영역 X)
   - PD FG = TilemapCollider X = Enemy 발판 X = 검사 영역 X
   - 실제 절벽 영역 정확 검출 → 투명벽 정확 위치

효과:
- 숨겨진 통로 = Player 자유 통과 (BT66 R2 영역 회복)
- 투명벽 = Level/AutoForeground 영역 가장자리만 검출·정확 위치
- Enemy 절벽 차단 = 투명벽 (Layer 18)
This commit is contained in:
깃 관리자 2026-05-08 15:12:03 +09:00
parent ad7cb55bf6
commit 0aead1ea49
1 changed files with 6 additions and 10 deletions

View File

@ -71,15 +71,15 @@ namespace Platformer.Mechanics
applied++;
}
// 2. PD Foreground = 가림막 시각 + TilemapCollider 부착 (BT82 정정·PD 보고: Enemy 떨어짐).
// 이전 BT66 R2의 Object.Destroy 폐기 — Player는 Drop-Through 패턴 영역에서 통과·착지 분기 / Enemy는 충돌 ON.
// Layer 16 강제 (AutoForeground와 동일·Drop-Through 패턴 적용).
// BT101 — PD Foreground = 시각 가림막만 (TilemapCollider 제거·BT66 R2 영역 회복).
// BT82 부착 영역 폐기 → 숨겨진 통로 영역 Player 통과 회복.
// Enemy 절벽 차단 = BT99 투명벽 영역으로 처리 (Layer 18·EnemyWall).
var pdForeground = GameObject.Find("Foreground");
if (pdForeground != null)
{
pdForeground.layer = 16;
var pdFgTc = pdForeground.GetComponent<UnityEngine.Tilemaps.TilemapCollider2D>();
if (pdFgTc == null) pdFgTc = pdForeground.AddComponent<UnityEngine.Tilemaps.TilemapCollider2D>();
if (pdFgTc != null) Object.Destroy(pdFgTc);
}
// 3. AutoForeground GameObject (Grid 자식·신규) — 자동 분류 발판 전용.
@ -172,16 +172,12 @@ namespace Platformer.Mechanics
int wallCount = 0;
// BT100 — 자체 가장자리 검사 = Level + AutoForeground 만 (PD Foreground = 시각 가림막·통로 영역 차단 X)
// BT101 — 자체·인접 검사 = Level + AutoForeground 만 (PD Foreground = TilemapCollider X·Enemy 발판 X·검사 영역 X)
var checkTilemaps = new System.Collections.Generic.List<UnityEngine.Tilemaps.Tilemap>();
if (levelTm != null) checkTilemaps.Add(levelTm);
if (autoFgTm != null) checkTilemaps.Add(autoFgTm);
// 인접 검사 = Level + AutoForeground + PD Foreground 모두 (안전 영역 모두 포함)
var allTilemaps = new System.Collections.Generic.List<UnityEngine.Tilemaps.Tilemap>();
if (levelTm != null) allTilemaps.Add(levelTm);
if (autoFgTm != null) allTilemaps.Add(autoFgTm);
if (pdFgTm != null) allTilemaps.Add(pdFgTm);
var allTilemaps = checkTilemaps;
foreach (var tm in checkTilemaps)
{