using UnityEngine;

namespace GGJam21.Core
{
	public class SoundManager : MonoBehaviour
	{
		public static SoundManager Instance = null;
		
		public AudioSource MusicSource;

		private void Awake()
		{
			if (Instance == null)
			{
				Instance = this;
			}	
			else if (Instance != this)
			{
				Destroy(gameObject);
			}
			DontDestroyOnLoad(gameObject);
		}

		public void PlayMusic(AudioClip clip)
		{
			MusicSource.clip = clip;
			MusicSource.Play();
		}
	}
}