private void OnCharacterDie() { GameSceneInstance gameSceneInstance = SceneManager.Instance.sceneInstance as GameSceneInstance; var characterDieParticle = gameSceneInstance.GetParticleInstance(ParticleInstanceType.CharacterDie) ?? gameSceneInstance.particlePool.RegisterRecyclableObject( Instantiate(_CharacterDieParticlePrefab)); characterDieParticle.transform.position = transform.position; characterDieParticle.PlayParticle(); behaviorController.StopBehaivor(); AudioManager.Instance.PlayAudio(_EnemyCharacterDieSound, false, 0.7f); onEnemyCharacterDie?.Invoke(); Destroy(gameObject); }
// 캐릭터 사망 시 호출되는 메서드 private void OnCharacterDie() { GameSceneInstance gameSceneInstance = SceneManager.Instance.sceneInstance as GameSceneInstance; var characterDieParticle = gameSceneInstance.GetParticleInstance(ParticleInstanceType.CharacterDie) ?? gameSceneInstance.particlePool.RegisterRecyclableObject( Instantiate(_DieParticlePrefab)); characterDieParticle.transform.position = transform.position; characterDieParticle.PlayParticle(); AudioManager.Instance.PlayAudio(_PlayerDieSound, false, 0.7f); PlayerManager.Instance.playerController.ClearPlayerableCharacter(); (playerController.screenInstance as GameScreenInsatnce).ShowGameOverPanel(); Destroy(gameObject); }