diff --git a/Assets/Scripts/Gameplay/PlayerDeath.cs b/Assets/Scripts/Gameplay/PlayerDeath.cs index 99f965a..680242d 100644 --- a/Assets/Scripts/Gameplay/PlayerDeath.cs +++ b/Assets/Scripts/Gameplay/PlayerDeath.cs @@ -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(); + if (body != null) body.simulated = false; + player.animator.SetTrigger("hurt"); player.animator.SetBool("dead", true); Simulation.Schedule(2); diff --git a/Assets/Scripts/Gameplay/PlayerSpawn.cs b/Assets/Scripts/Gameplay/PlayerSpawn.cs index 468a94d..c0ebc2f 100644 --- a/Assets/Scripts/Gameplay/PlayerSpawn.cs +++ b/Assets/Scripts/Gameplay/PlayerSpawn.cs @@ -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(); + 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(2f); diff --git a/Assets/Scripts/Skills/Effectors/LaserSpawner.cs b/Assets/Scripts/Skills/Effectors/LaserSpawner.cs index 86c2691..44f59a3 100644 --- a/Assets/Scripts/Skills/Effectors/LaserSpawner.cs +++ b/Assets/Scripts/Skills/Effectors/LaserSpawner.cs @@ -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); diff --git a/Assets/Scripts/Skills/Effectors/LightningStrikeSpawner.cs b/Assets/Scripts/Skills/Effectors/LightningStrikeSpawner.cs index e909fe2..0e3a4e6 100644 --- a/Assets/Scripts/Skills/Effectors/LightningStrikeSpawner.cs +++ b/Assets/Scripts/Skills/Effectors/LightningStrikeSpawner.cs @@ -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)); } } } diff --git a/Assets/Scripts/Skills/Effectors/MeleeAreaSpawner.cs b/Assets/Scripts/Skills/Effectors/MeleeAreaSpawner.cs index 211eb57..003ee82 100644 --- a/Assets/Scripts/Skills/Effectors/MeleeAreaSpawner.cs +++ b/Assets/Scripts/Skills/Effectors/MeleeAreaSpawner.cs @@ -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 따라감 diff --git a/Assets/Scripts/Skills/Effectors/Projectile.cs b/Assets/Scripts/Skills/Effectors/Projectile.cs index 71af439..9522ca1 100644 --- a/Assets/Scripts/Skills/Effectors/Projectile.cs +++ b/Assets/Scripts/Skills/Effectors/Projectile.cs @@ -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)); } } }