using UnityEngine;
using System.Collections;

public class Box_Sound : MonoBehaviour {

	public AudioClip crash;

	float minPitch = 0.75f;
	float maxPitch = 1.25f;
	float minVol = 0.5f;
	float maxVol = 1f;
	float vol;

	


	AudioSource sound;

	// Use this for initialization
	void Start () {

		sound = GetComponent<AudioSource>();
	
	}

	void OnCollisionEnter (Collision Coll){
		vol = Random.Range(minVol, maxVol);
		sound.pitch = Random.Range(minPitch,maxPitch);
			sound.PlayOneShot(crash,vol);

	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
