using UnityEngine;
using System.Collections;
using UnityEngine.UI;

[RequireComponent (typeof(Button))]
public class ButtonClickSoundPlayer : MonoBehaviour
{
	public AudioClip sound;

	// Use this for initialization
	void Start ()
	{
		this.GetComponent<Button> ().onClick.AddListener (delegate() {
			if (this.sound != null) {
				AudioManager2D.instance.PlaySound (this.sound);	
			}
		});
	}
}
