using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SoundManager : MonoBehaviour {

  public static SoundManager Instance {
    get { return instance; }
  }
  static SoundManager instance;

  [SerializeField]
  private AudioSource ring;
  [SerializeField]
  private AudioSource alarm;
  [SerializeField]
  private AudioSource angry;
  [SerializeField]
  private AudioSource success;

	// Use this for initialization
  public void PlaySound(string name) {
    switch(name) {
      case "Ring":
        ring.Play();
        break;
      case "Alarm":
        alarm.Play();
        break;
      case "Angry":
        angry.Play();
        break;
      case "Success":
        success.Play();
        break;
    }
  }

  private void Start() {
    if (instance != null) {
      Destroy(this);
      return;
    }
    instance = this;
  }
}
