using UnityEngine;
using System.Collections;

public class Fire : MonoBehaviour {
	public Transform [] fires;
	int count = 0;
	// Use this for initialization
	void Start () {
		AudioManager.instance.Play (Sounds.Fire, transform);
		InvokeRepeating("FireChange",0f,0.1f);
		Destroy(gameObject, 5f);
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void FireChange(){
		fires[count].gameObject.SetActive(false);
		count++;
		if (count == fires.Length)
			count = 0;
			
		fires[count].gameObject.SetActive(true);
	}
}
