fix(BT12-Dev): Player 사망 제자리·부활 모션·무적 + FX 잔상 safety cap (PD 지시 2026-05-13)

작업 1 — Player 사망 사라지는 현상 fix:
- PlayerDeath.Execute — Rigidbody2D.simulated=false (gravity 정지·제자리 사망·낙사 차단)

작업 2·3 — 제자리 부활·부활 모션·2초 무적 깜박:
- PlayerSpawn.Execute — Teleport 폐기 (spawn point 영역 → 제자리)
- player.health.Resurrect() 호출 (currentHP=maxHP·invulnerableUntil=2초·Animator dead=false·resurrect Trigger)
- Rigidbody2D.simulated=true 복원
- PlayerInvulnerabilityFlash 영역 IsInvulnerable 자동 깜박 (2초)
- 2초 후 EnablePlayerInput (조작 가능)

작업 4 — FX 잔상 safety cap 5초:
- LaserSpawner.Trigger — fx Object.Destroy 누락 fix (LaserSpawner 영역 본 영역 영역 영역 직접 원인 가능)
- LightningStrikeSpawner.AutoDestroyFx — cap
- MeleeAreaSpawner.Trigger — cap
- Projectile.AutoDestroyOnParticleEnd — cap

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
깃 관리자 2026-05-13 20:02:43 +09:00
parent ebd7086a53
commit 3a672f0591
6 changed files with 23 additions and 6 deletions

View File

@ -31,6 +31,10 @@ namespace Platformer.Gameplay
// PD 지시 2026-05-13 — 사망 모션 시각 위치 보정 y -0.3 (sprite 위로 떠 보이는 현상 정정)
player.transform.position += new Vector3(0f, -0.3f, 0f);
// PD 지시 2026-05-13 — Player 사망 시 사라지는 현상 fix — Rigidbody2D.simulated=false (gravity 정지·제자리 사망·낙사 차단)
var body = player.GetComponent<Rigidbody2D>();
if (body != null) body.simulated = false;
player.animator.SetTrigger("hurt");
player.animator.SetBool("dead", true);
Simulation.Schedule<PlayerSpawn>(2);

View File

@ -18,10 +18,18 @@ namespace Platformer.Gameplay
player.controlEnabled = false;
if (player.audioSource && player.respawnAudio)
player.audioSource.PlayOneShot(player.respawnAudio);
player.health.Increment();
player.Teleport(model.spawnPoint.transform.position);
// PD 지시 2026-05-13 — 제자리 부활 (Teleport 폐기) + Health.Resurrect 호출
// Resurrect = currentHP=maxHP·invulnerableUntil=2초·Animator dead=false·resurrect Trigger
// PlayerInvulnerabilityFlash 영역 IsInvulnerable 자동 깜박 (2초)
player.health.Resurrect();
// PD 지시 2026-05-13 — PlayerDeath 영역 Rigidbody2D.simulated=false 복원
var body = player.GetComponent<Rigidbody2D>();
if (body != null) body.simulated = true;
player.jumpState = PlayerController.JumpState.Grounded;
player.animator.SetBool("dead", false);
// animator.SetBool("dead", false)·SetTrigger("resurrect") = Health.Resurrect 내부 호출됨
model.virtualCamera.Follow = player.transform;
model.virtualCamera.LookAt = player.transform;
Simulation.Schedule<EnablePlayerInput>(2f);

View File

@ -42,6 +42,8 @@ namespace EerieVillage.Skills.Effectors
}
float fxLifetime = GetFxLifetime(fx);
// PD 지시 2026-05-13 — fx AutoDestroy 누락 fix·safety cap 5초 (잔상 차단)
if (fx != null) Object.Destroy(fx, Mathf.Min(fxLifetime + 0.2f, 5f));
int damage = Mathf.Max(data.BaseDamage, 1);
float length = Mathf.Max(data.HitboxSize.x, 1f);
float width = Mathf.Max(data.HitboxSize.y, 0.5f);

View File

@ -154,7 +154,8 @@ namespace EerieVillage.Skills.Effectors
static void AutoDestroyFx(GameObject fxGo, float lifetime)
{
if (fxGo == null) return;
Object.Destroy(fxGo, lifetime + 0.2f);
// PD 지시 2026-05-13 — FX 잔상 safety cap 5초
Object.Destroy(fxGo, Mathf.Min(lifetime + 0.2f, 5f));
}
}
}

View File

@ -41,7 +41,8 @@ namespace EerieVillage.Skills.Effectors
// Player 자식 부착 (worldPositionStays=true) 으로 spawn 후에도 Player 이동에 동조.
fxGo.transform.SetParent(inventory.transform, true);
fxLifetime = GetFxLifetime(fxGo);
Object.Destroy(fxGo, fxLifetime + 0.2f);
// PD 지시 2026-05-13 — FX 잔상 safety cap 5초
Object.Destroy(fxGo, Mathf.Min(fxLifetime + 0.2f, 5f));
}
// PD 지시 2026-05-13 — 박스 영역 Player 자식 영역 부착·매 frame Player 따라감

View File

@ -292,7 +292,8 @@ namespace EerieVillage.Skills.Effectors
var main = ps.main;
lifetime = main.duration + main.startLifetime.constantMax + 0.2f;
}
Object.Destroy(fxGo, lifetime);
// PD 지시 2026-05-13 — FX 잔상 safety cap 5초
Object.Destroy(fxGo, Mathf.Min(lifetime, 5f));
}
}
}