using UnityEngine;
using System.Collections;

public class MusicManager : MonoBehaviour {

	private static MusicManager instance;
	private static AudioSource audioSource;
	public static MusicManager Instance{
		get {
			if(instance == null) {
				audioSource = new GameObject ("MusicManager").AddComponent< AudioSource >();
				instance = audioSource.gameObject.AddComponent< MusicManager > ();
			}
			return instance;
		}
	}

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