using UnityEngine;
using System.Collections;
[System.Serializable]
public class MusicMixer : MonoBehaviour {
	public AudioClip[] tracks;
	// Use this for initialization
	void Start () 
	{
		audio.clip = tracks[Random.Range(0,tracks.Length-1)];
		audio.volume = GameOptions.musicVolume;
		audio.Play();
	}
	
	// Update is called once per frame
	void Update () 
	{
		if(audio.isPlaying==false)
		{
			audio.clip = tracks[Random.Range(0,tracks.Length-1)];
			audio.volume = GameOptions.musicVolume;
			audio.Play();
		}
	}
}
