fix(BT12-Dev-Clone): 분신 투사체 방향 정합 + Player 사망 시 분신 즉시 destroy (PD 지시 2026-05-18)

PD 보고 2건:
1. 분신 영역 투사체 영역 영역 영역 영역 영역 X
   원인: _spawnFacingX 영역 spawn 시점 영역 영역 영역 → Player facing 변경 후 분신 발동 시 영역 영역 영역 영역 영역 영역
   fix: SyncSpriteAndPosition 영역 매 frame _spawnFacingX 영역 영역 영역 (pc.Facing 영역)
        → 분신 발동 시 CloneFireFacingX = _spawnFacingX (영역 영역 영역 영역) → 투사체 정합 영역
   PD 결정 4번 (facing 고정) 영역 — 분신 영역 영역 영역 영역 영역 영역 영역 (시각 영역 영역 영역 — 직전 fix 영역 영역) → facing 영역 영역 영역

2. Player hit·death 영역 분신 영역 영역 영역 (잔존 현상)
   원인: CloneInstance.Update 영역 lifetime 12초 영역 영역 영역 → Player 영역 영역 영역 영역 분신 영역
   fix: Update 영역 매 frame Health.IsAlive 영역 영역 → false 영역 분신 즉시 Destroy(gameObject)
        + _playerInventory == null 영역 영역 destroy (Player.gameObject Destroy 영역 영역)

MCP 검증: refresh_unity + read_console errors 0
This commit is contained in:
깃 관리자 2026-05-18 19:46:20 +09:00
parent 779f3163cf
commit 412dedb7bc
1 changed files with 16 additions and 2 deletions

View File

@ -191,6 +191,19 @@ namespace EerieVillage.Skills.Effectors
return;
}
// PD 지시 2026-05-18 — Player 영역 영역 영역 영역 분신 즉시 destroy (영역 영역 영역 X)
if (_playerInventory == null)
{
Destroy(gameObject);
return;
}
var playerHealth = _playerInventory.GetComponent<Health>();
if (playerHealth != null && !playerHealth.IsAlive)
{
Destroy(gameObject);
return;
}
// BT12-Dev-Clone (2026-05-18) — 매 frame Player sprite 동기화 + 위치 영역 영역 영역
SyncSpriteAndPosition();
@ -218,15 +231,16 @@ namespace EerieVillage.Skills.Effectors
// 2. PD 지시 2026-05-18 — 목표 위치 영역 = Player worldPos + facing 반대 0.5 영역 (50% 영역)
// SetParent X · 독립 GameObject 영역 — Player.localScale 영역 영역 영역 영역 영역 영역 영역.
// PD 지시 2026-05-18 — _spawnFacingX 매 frame 영역 영역 (Player facing 영역) → 분신 발동 시 투사체 영역 정합 영역.
Vector3 playerWorldPos = _playerInventory.transform.position;
float signX = 1f;
var pc = _playerInventory.GetComponent<PlayerController>();
if (pc != null)
{
Vector2 facing = pc.Facing;
if (facing.sqrMagnitude > 0.01f)
signX = facing.x < 0f ? -1f : 1f;
_spawnFacingX = facing.x < 0f ? -1f : 1f; // 매 frame Player facing 영역 영역 갱신
}
float signX = _spawnFacingX;
_targetLocalPos = playerWorldPos + new Vector3(-signX * SPAWN_OFFSET_X, 0f, 0f); // worldPos target
// 3. 영역 영역 영역 영역 영역 영역 영역 (MoveTowards · worldPos 기반)