using UnityEngine;
using System.Collections;

public class explosion_script : MonoBehaviour {
	
	
	private Light light;
	private string etat = "moreLight";
	
	// Use this for initialization
	void Start () {
	
		Transform transformLight = transform.FindChild("light_explosion");

		light = transformLight.light;	
		light.intensity = 0;
		
	}
	
	// Update is called once per frame
	void Update () {
		
		if(light.intensity > 2.3f){
			etat = "lessLight";
		}
		
		
		if(etat == "moreLight"){
			light.intensity += Time.deltaTime *0.8f;
		}
		
		if(etat == "lessLight"){
			light.intensity -= Time.deltaTime * 0.5f;;
		}
		
		//haloExplosion = Mathf.Abs(Mathf.Sin(Time.time))*2.0f;
	}
}