using UnityEngine;
using System.Collections;

public class HomeSteepleManager : MonoBehaviour {
	public Vector2 StartPosition;
	public float coolDown = 5f;
	float coolDownMax = 30f;
	public AudioSource speakerAudio;
	
	void Awake()
	{
		StartPosition = new Vector2(74.52f,-2.6f);
		speakerAudio = gameObject.GetComponent<AudioSource>();
		speakerAudio.enabled = false;
	}

	void Update()
	{
		if(coolDown > 0)
		{
			if(speakerAudio.enabled)
				coolDown -= Time.deltaTime;
		}

		if(coolDown <= 0)
			PlaySpeaker();
	}

	void PlaySpeaker()
	{
		coolDown = coolDownMax;
		speakerAudio.Play();
	}


}
