using UnityEngine;
using System.Collections;

public class AudioManagerScript : MonoBehaviour {

	public static AudioManagerScript instance;
	public AudioSource music;

	// Use this for initialization
	void Start () {
		instance = this;
		if (PlayerPrefs.GetFloat ("time") != null) {
			music.time = PlayerPrefs.GetFloat ("time");
			music.Play ();
		} else {
			print ("porra");
			music.Play ();
		}
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	public void saveCurrentTimeSong()
	{
		PlayerPrefs.SetFloat ("time", music.time);
	}

	void continueSong(){
		float time = PlayerPrefs.GetFloat ("time");
		music.PlayDelayed (time);

	}
}
