using Level;
using UnityEngine;

namespace Player
{
    public class Death : MonoBehaviour
    {
        private AudioSource audioSource = null;

        private void Start() => audioSource = GetComponent<AudioSource>();

        public void Die()
        {
            LevelManager.Instance.CurrentLevel.Restart();
            // Playing it after the restart because when the player gets deactivated the sound stops so it doesn't play the sound at all
            audioSource.Play();
        }
    }
}
