using Platformer.Core; using Platformer.Mechanics; using Platformer.Model; namespace Platformer.Gameplay { /// /// Fired when the player is spawned after dying. /// public class PlayerSpawn : Simulation.Event { PlatformerModel model = Simulation.GetModel(); public override void Execute() { var player = model.player; player.collider2d.enabled = true; player.controlEnabled = false; if (player.audioSource && player.respawnAudio) player.audioSource.PlayOneShot(player.respawnAudio); // 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; // animator.SetBool("dead", false)·SetTrigger("resurrect") = Health.Resurrect 내부 호출됨 model.virtualCamera.Follow = player.transform; model.virtualCamera.LookAt = player.transform; Simulation.Schedule(2f); } } }