using UnityEngine;
using System.Collections;

public class MusicManager : MonoBehaviour 
{
    public float m_fadeTime;
    public float m_curFadeTime;
    public AudioSource m_sound;
	// Use this for initialization
	void Start () 
    {
        m_curFadeTime = 0;
        m_sound.volume = 0;
        m_sound.Play();
	}
	
	// Update is called once per frame
	void Update () 
    {
        m_curFadeTime += Time.deltaTime;
        float vol = m_curFadeTime / m_fadeTime;
        if(vol > 1)
        {
            vol = 1;
        }
        m_sound.volume = vol;
	}
}
