diff --git a/Assets/Scripts/Mechanics/GameOptimizer.cs b/Assets/Scripts/Mechanics/GameOptimizer.cs index 758c58a..1acca08 100644 --- a/Assets/Scripts/Mechanics/GameOptimizer.cs +++ b/Assets/Scripts/Mechanics/GameOptimizer.cs @@ -80,14 +80,18 @@ namespace Platformer.Mechanics fgTilemap = foreground.GetComponent(); } - // BT52-A — 자동 분류 알고리즘 보수적 정정 (PD 옵션 A 채택 2026-05-07). - // BT47/BT48 임계값(playerY+1.5)·작은 발판(가로≤8+위·아래 빈) 휴리스틱 폐기. - // 근거: Editor.log [BT48-MoveTiles] moved=3524 비정상 (정상 1389 대비 2.5배) - // = 휴리스틱이 정상 길·배경 벽지까지 자동 Foreground 이동 → "숨겨진 레이어가 정상적인 길을 막고 있어" 근본 원인. - // 새 알고리즘: Tile asset 이름 prefix "TileFloating" 3종만 명확한 공중 발판 의도로 자동 분류. - // (TileFloatingLeftEdge·TileFloatingRightEdge·TileFloatingTileMiddle — 카탈로그 17종 중 명시적 Floating 의도 3종) - // 그 외 모든 Tile = Level 잔존 (PD Inspector 직접 의도 분류 — 표준 Unity Tilemap 워크플로우). - // 마이그레이션 X (PD 옵션 A 결정 — Foreground 변경 X·위험 최소화). + // BT53-A1 — 자동 분류 카탈로그 확장 (PD 옵션 A1 채택 2026-05-07). + // BT52 TileFloating* 단일 매칭 → 8종 카탈로그 확장. + // 근거: BT47/BT48 정상 시점(moved=1389)에 PD가 통과 가능 인식한 영역 + // = 배경·건물 7종이 자동 Foreground 이동된 결과로 추정. + // 카탈로그 (자동 Foreground 이동): + // 1. TileFloating* (3종) — 공중 발판 + // 2. ShortBuilding·TallBuilding·MidgroundFiller (3종) — 건물·배경 채움 + // 3. cloud·hillside·midground·mountains (4종) — 배경 (Parallax) + // Level 잔존 (영구 충돌 또는 자연 통과): + // - TileGround·TileGroundDark·TileGroundTop (3종) — 지면 (영구 충돌) + // - tree·plant·fence·house (4종 None) — Tile 자체 None Collider (자연 통과) + // 마이그레이션 X (PD 옵션 A 결정 — Foreground 변경 X·위험 최소화). var levelGo = GameObject.Find("Level"); if (levelGo != null && fgTilemap != null) { @@ -95,7 +99,7 @@ namespace Platformer.Mechanics if (levelTilemap != null) { var bounds = levelTilemap.cellBounds; - int movedFloating = 0; + int movedFloating = 0, movedDecor = 0; for (int x = bounds.xMin; x <= bounds.xMax; x++) { for (int y = bounds.yMin; y <= bounds.yMax; y++) @@ -105,18 +109,22 @@ namespace Platformer.Mechanics var tileAsset = levelTilemap.GetTile(pos); if (tileAsset == null) continue; string nm = tileAsset.name ?? string.Empty; - if (!nm.StartsWith("TileFloating")) continue; + bool isFloating = nm.StartsWith("TileFloating"); + bool isDecor = nm == "ShortBuilding" || nm == "TallBuilding" || nm == "MidgroundFiller" + || nm == "cloud" || nm == "hillside" || nm == "midground" || nm == "mountains"; + if (!isFloating && !isDecor) continue; var tile = levelTilemap.GetTile(pos); fgTilemap.SetTile(pos, tile); fgTilemap.SetColliderType(pos, UnityEngine.Tilemaps.Tile.ColliderType.Sprite); levelTilemap.SetTile(pos, null); - movedFloating++; + if (isFloating) movedFloating++; + else movedDecor++; } } if (fgTc != null) fgTc.ProcessTilemapChanges(); var lvlTc = levelGo.GetComponent(); if (lvlTc != null) lvlTc.ProcessTilemapChanges(); - Debug.Log($"[BT52-Classify] floating moved={movedFloating} (Level→Foreground TileFloating* 3종만 / 마이그레이션 X)"); + Debug.Log($"[BT53-Classify] moved={movedFloating + movedDecor} (floating={movedFloating} TileFloating* / decor={movedDecor} 배경·건물 7종 / TileGround*+None 잔존)"); } }