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

public class AudioController : MonoBehaviour {
  public AudioSource Source;
  public AudioSource MusicSource;

  public AudioClip success1Clip;
  public AudioClip success2Clip;

  public void PlaySuccess1() {
    Source.PlayOneShot(success1Clip);
  }

  public void PlaySuccess2() {
    Source.PlayOneShot(success2Clip);
  }

  public void StartMusic1() {
    MusicSource.loop = true;
    MusicSource.Play();
  }

  private static AudioController _instance;
  public static AudioController Instance {
    get {
      if (_instance == null) {
        _instance = GameObject.FindGameObjectWithTag("GameController").GetComponentInChildren<AudioController>();
      }
      return _instance;
    }
  }
}
