using UnityEngine;
using System.Collections;
public class SoundManager : MonoBehaviour {
// Use this for initialization
void Start () {
GameEventManager.GameStart += GameStart;
GameEventManager.GameOver += GameOver;
}
// Update is called once per frame
void Update () {
}
private void GameStart(){
if(!this.GetComponent<AudioSource>().isPlaying)
this.GetComponent<AudioSource> ().Play ();
}
private void GameOver(){
if(this.GetComponent<AudioSource>().isPlaying)
this.GetComponent<AudioSource> ().Stop ();
}
}