From 2516ef9cb12785e4c8a3e53e4cc4769e60c316ef Mon Sep 17 00:00:00 2001 From: swrring Date: Fri, 15 May 2026 11:08:30 +0900 Subject: [PATCH] =?UTF-8?q?fix(BT12-Dev):=20A06=20=EB=8F=85=20=EB=8A=AA=20?= =?UTF-8?q?ground=20=EC=98=81=EC=97=AD=EB=A7=8C=20spawn=20(PD=20=EC=A7=80?= =?UTF-8?q?=EC=8B=9C=202026-05-15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PD 보고: "독 늪은 공중에 생성 되지 않도록 수정해줘. (플레이어나 몬스터가 밟고 이동할 수 있는 영역에만 생성 가능해야 함)" 정정 PoisonSwampSpawner.Trigger: 1. nearest Enemy 탐색에서 IsFlying=true (박쥐 등) skip - 공중 박쥐 위치 spawn 후보 제외 2. spawn 후보 (nearest 또는 Player 위치 + OffsetXY) 에서 Vector2.down Raycast (거리 20, groundLayerMask Layer 0 + Layer 16) 3. Raycast hit X → return (spawn 차단) 4. Raycast hit O → spawnPos.y = groundHit.point.y (ground 표면 위) groundLayerMask = (1 << 0) | (1 << 16): - Layer 0 : Level Tilemap (메인 ground) - Layer 16: Floating 발판 (Foreground) 검증 (Play 모드): - 시나리오 1 (Player 지면): spawn 1기·pos.y=-2.88 (ground 위) - 시나리오 2 (Player y=50 공중·모든 Enemy IsFlying): spawn 증가 0 (차단) Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Scripts/Skills/Effectors/PoisonSwampSpawner.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Skills/Effectors/PoisonSwampSpawner.cs b/Assets/Scripts/Skills/Effectors/PoisonSwampSpawner.cs index 8f1cadb..c23deb1 100644 --- a/Assets/Scripts/Skills/Effectors/PoisonSwampSpawner.cs +++ b/Assets/Scripts/Skills/Effectors/PoisonSwampSpawner.cs @@ -35,14 +35,23 @@ namespace EerieVillage.Skills.Effectors if (e == null) continue; var h = e.GetComponent(); if (h == null || !h.IsAlive) continue; + // PD 지시 2026-05-15 — 공중 몬스터 (박쥐 등) skip · 독 늪 ground spawn 의도 + if (e.IsFlying) continue; var p = e.transform.position; if (p.x < camPos.x - halfW || p.x > camPos.x + halfW || p.y < camPos.y - halfH || p.y > camPos.y + halfH) continue; float d = Vector2.Distance(playerPos, p); if (d < minDist) { minDist = d; nearest = e; } } - Vector2 spawnPos = nearest != null ? (Vector2)nearest.transform.position : playerPos; - spawnPos += data.OffsetXY; + Vector2 candidate = nearest != null ? (Vector2)nearest.transform.position : playerPos; + candidate += data.OffsetXY; + + // PD 지시 2026-05-15 — ground Raycast 영역 ground 영역 영역 spawn (공중 spawn 차단) + // groundLayerMask = Layer 0 (Level Tilemap) + Layer 16 (Floating 발판) + int groundLayerMask = (1 << 0) | (1 << 16); + RaycastHit2D groundHit = Physics2D.Raycast(candidate, Vector2.down, 20f, groundLayerMask); + if (groundHit.collider == null) return; // ground 미검출 — spawn 차단 + Vector2 spawnPos = new Vector2(candidate.x, groundHit.point.y); // 독 늪 GO spawn (OnHitFxPrefab = FX_Venom_Swamp) GameObject swampGo;