using UnityEngine;
using System.Collections;

public class TrainHornSound : MonoBehaviour {

	private float trainHornIntervalCounter = 0.0f;


	// Use this for initialization
	void Start () {
	
		trainHornIntervalCounter = Random.Range(30.0f, 90.0f);

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

		trainHornIntervalCounter -= Time.deltaTime;
	
		if(trainHornIntervalCounter <= 0.0f){
			gameObject.audio.Play();
			trainHornIntervalCounter = Random.Range(30.0f, 90.0f);
		}

	}
}
