using UnityEngine;
using System.Collections;

public class WaveEmitterScript : MonoBehaviour {

	public float waveForce;
	public GameObject waveEmissionArea;
	public string waveName;

	public float delay;
	float timer;
	public bool mute;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		timer += Time.deltaTime;

		if (timer > delay) {
			GameObject wave = WaveInstantiatorScript.instance.createWave (waveName, this.transform.position);
			if (mute) {
				wave.GetComponent<WaveEffectScript> ().audio.volume = 0;
			}
			timer = 0;
		}
	}
}
