BT5-Dev #28: Tilemap Layer 8 변환 + STOMP_DELTA 시각 정합 (-0.4~-0.05)
PD 보고: 1. 발판 통과 X — Tilemap Layer 0 그대로 → 일반 충돌 → 점프 통과 X 2. 밟기 위치 너무 높음 — STOMP_DELTA_MAX +0.1 → 시각 발이 Enemy 머리 위 0.1 떠 있음 데이터 진단: - [BT27-JumpThrough] applied=1 (Alien only) — Tilemap 제외로 발판 영역 미적용 - [PEC] stomped=True delta=-0.11~-0.28 — Collider 영역만 정합 / 시각 영역 차이 0.2 정정: - GameOptimizer: TilemapCollider2D 제외 영역 폐기 → 모든 일반 Collider Layer 8 변환 - PlayerEnemyCollision: STOMP_DELTA -0.3~+0.1 → -0.4~-0.05 (Player Collider Offset +0.10 + Enemy sprite 위 여백 0.1 보정) Drop-Through 패턴 동작: - 모든 지면·발판 Layer 8 = 기본 통과 (Player 13 ↔ Layer 8 IgnoreLayerCollision) - Player 하강 + 발 Raycast hit → IgnoreCollision(false) 임시 활성 = 착지 - 점프(상승) → IgnoreCollision(true) 복구 = 통과
This commit is contained in:
parent
98bfbd74a2
commit
151cd1794b
|
|
@ -31,6 +31,8 @@ namespace Platformer.Mechanics
|
||||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
||||||
static void SetupJumpThroughPlatforms()
|
static void SetupJumpThroughPlatforms()
|
||||||
{
|
{
|
||||||
|
// BT5-Dev #28 — Tilemap 영역 포함 모든 일반 Collider Layer 8 변환.
|
||||||
|
// Drop-Through 표준 패턴 = 모든 발판·지면이 Layer 8. PlatformDropThrough Raycast가 하강 시 충돌 활성 = 착지.
|
||||||
int applied = 0, excluded = 0;
|
int applied = 0, excluded = 0;
|
||||||
var allColliders = Object.FindObjectsByType<Collider2D>(FindObjectsSortMode.None);
|
var allColliders = Object.FindObjectsByType<Collider2D>(FindObjectsSortMode.None);
|
||||||
var appliedNames = new System.Collections.Generic.List<string>();
|
var appliedNames = new System.Collections.Generic.List<string>();
|
||||||
|
|
@ -38,7 +40,6 @@ namespace Platformer.Mechanics
|
||||||
{
|
{
|
||||||
if (c == null) continue;
|
if (c == null) continue;
|
||||||
if (c.isTrigger) { excluded++; continue; }
|
if (c.isTrigger) { excluded++; continue; }
|
||||||
if (c.GetComponent<UnityEngine.Tilemaps.TilemapCollider2D>() != null) { excluded++; continue; }
|
|
||||||
if (c.GetComponent<PlayerController>() != null
|
if (c.GetComponent<PlayerController>() != null
|
||||||
|| c.GetComponent<EnemyController>() != null
|
|| c.GetComponent<EnemyController>() != null
|
||||||
|| c.GetComponent<DeathZone>() != null
|
|| c.GetComponent<DeathZone>() != null
|
||||||
|
|
@ -50,18 +51,18 @@ namespace Platformer.Mechanics
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlatformEffector2D 잔존 영역 제거 (BT25 누적 영향 차단)
|
// PlatformEffector2D 잔존 제거 (BT25 누적 영향 차단)
|
||||||
var effector = c.GetComponent<PlatformEffector2D>();
|
var effector = c.GetComponent<PlatformEffector2D>();
|
||||||
if (effector != null) Object.Destroy(effector);
|
if (effector != null) Object.Destroy(effector);
|
||||||
c.usedByEffector = false;
|
c.usedByEffector = false;
|
||||||
|
|
||||||
// Layer 8 변환 → IgnoreLayerCollision로 기본 통과
|
// Layer 8 변환 → IgnoreLayerCollision 기본 통과 + PlatformDropThrough Raycast 착지
|
||||||
c.gameObject.layer = 8;
|
c.gameObject.layer = 8;
|
||||||
applied++;
|
applied++;
|
||||||
if (appliedNames.Count < 8) appliedNames.Add($"{c.gameObject.name}({c.GetType().Name})");
|
if (appliedNames.Count < 8) appliedNames.Add($"{c.gameObject.name}({c.GetType().Name})");
|
||||||
}
|
}
|
||||||
Debug.Log($"[BT27-JumpThrough] applied={applied} excluded={excluded} total={allColliders.Length}");
|
Debug.Log($"[BT28-JumpThrough] applied={applied} excluded={excluded} total={allColliders.Length}");
|
||||||
Debug.Log($"[BT27-JumpThrough] appliedSamples=[{string.Join(", ", appliedNames)}]");
|
Debug.Log($"[BT28-JumpThrough] appliedSamples=[{string.Join(", ", appliedNames)}]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bc0df74503a03ee478bb504a5cd1b0c3
|
||||||
Loading…
Reference in New Issue