fix(BT12-Dev): Wall OverlapPoint grace 0.05s + spawn OffsetDistance (회귀 정정)

This commit is contained in:
깃 관리자 2026-05-10 16:50:08 +09:00
parent 3f69cc04fe
commit 6a160d5f5f
2 changed files with 13 additions and 5 deletions

View File

@ -23,6 +23,7 @@ namespace EerieVillage.Skills.Effectors
// BT12-Dev 2026-05-10 (PD #1·#2) — 거리 제한·벽 충돌 영역
protected Vector2 _spawnPosition;
protected float _maxRange;
protected float _spawnTime;
// 동일 투사체로 동일 Collider 중복 타격 방지
protected readonly HashSet<Collider2D> _hitTargets = new HashSet<Collider2D>();
@ -40,6 +41,7 @@ namespace EerieVillage.Skills.Effectors
// BT12-Dev 2026-05-10 (PD #1) — 거리 제한 영역 영역 spawn 위치 저장
_spawnPosition = transform.position;
_spawnTime = Time.time;
// 최대 거리 = Camera 영역 영역 영역 × 1.5 (PD #1 명시)
// Camera ortho size 3.5·aspect 16:9 → height 7·width ~12.44 → maxRange ~18.66 unit
@ -74,11 +76,15 @@ namespace EerieVillage.Skills.Effectors
return;
}
// BT12-Dev 2026-05-10 (PD #2 fix) — Wall 영역 OverlapPoint 영역 검출 (OnTriggerEnter2D 영역 Static collider 영역 발화 X)
var wallHit = Physics2D.OverlapPoint(transform.position, WallLayerMask);
if (wallHit != null)
// BT12-Dev 2026-05-10 (PD #2 fix·재발 정정) — Wall OverlapPoint·grace period 0.05s 영역 spawn 시점 즉시 SelfDestruct 회피.
// Player.position 영역 spawn 영역 — Player 영역 ground tile 영역 영역 영역 → 첫 frame OverlapPoint hit → 회귀.
if (Time.time - _spawnTime > 0.05f)
{
SelfDestruct();
var wallHit = Physics2D.OverlapPoint(transform.position, WallLayerMask);
if (wallHit != null)
{
SelfDestruct();
}
}
}

View File

@ -20,13 +20,15 @@ namespace EerieVillage.Skills.Effectors
// 플레이어 위치·방향 취득
Transform playerTransform = inventory.transform;
Vector2 spawnPos = playerTransform.position;
// PlayerController.Facing 참조
Vector2 facing = Vector2.right;
var pc = inventory.GetComponent<PlayerController>();
if (pc != null) facing = pc.Facing;
// BT12-Dev 2026-05-10 회귀 정정 — OffsetDistance 영역 적용 (Player 영역 영역 영역 spawn → Player 영역 OverlapPoint hit·즉시 SelfDestruct 회피)
Vector2 spawnPos = (Vector2)playerTransform.position + facing * data.OffsetDistance;
// 프리팹 로드 (없으면 fallback — Trigger 영역에서 직접 생성)
GameObject prefab = LoadProjectilePrefab();