using UnityEngine;
using System.Collections;

public class s_TitleMusic: MonoBehaviour
{
	 private static s_TitleMusic instance = null;
	
	void Awake()
	{
		if (instance != null && instance != this)
		{
            Destroy(this.gameObject);
            return;
        }
		else 
            instance = this;
		
		DontDestroyOnLoad(this.gameObject);
	}
	
	void Update()
	{
		//Destorys itself if not in the title or game scene
		if (Application.loadedLevelName == "MainMenu"
			|| Application.loadedLevelName == "HowToPlay"
			|| Application.loadedLevelName == "LevelSelect")
		{}
		else
			Destroy(gameObject);
		
		
	}
}
