using UnityEngine;
using System.Collections;

public class SoundPlayer : MonoBehaviour {

	public static SoundPlayer player;

	public AudioClip foodPickup; //inspector
	public AudioClip rhinoRelease;  //inspector
	public AudioClip slugHit1; //inspector
	public AudioClip slugHit2; //inspector

	void Start() {
		player = this;
	}

	public void PlayRhinoRelease() {
		PlaySound (rhinoRelease);
	}

	public void PlayFoodPickup() {
		PlaySound (foodPickup);
	}

	public void PlaySlugHit() {
		if (Random.value > 0.5) {
			PlaySound (slugHit1);
		} else {
			PlaySound (slugHit2);
		}
	}

	public void PlaySound(AudioClip clip) {
		AudioSource.PlayClipAtPoint (clip, Vector3.zero);
	}
	
}
