var player:Player;

static var store:boolean;
static var gameOver:boolean = false;

var musicClip:AudioClip[];

var track:int = 1;


function Awake () {
	if(store){
        DestroyImmediate(gameObject);
	}
    else
    {
        DontDestroyOnLoad(gameObject);
        store = this;
    }
}


function Start () {
	yield playPlaylist();
}

function playPlaylist(){
	while(true){
		this.gameObject.GetComponent(AudioSource).clip = musicClip[track];
		this.gameObject.GetComponent(AudioSource).Play();
		
		yield WaitForSeconds (this.gameObject.GetComponent(AudioSource).clip.length);
		
		if(track<6){
			track++;
		}else{
			track = 0;
		}
	}
}

function Update () {
}



function playerDetails(name:String){
	player = new Player(name, 'new');
}