using UnityEngine;
using System.Collections;
using UnityStandardAssets.ImageEffects;
public class FX : MonoBehaviour {

    public float bloom_intensity = 0.0f;
    public static event System.Action PreUpdate;

	// Use this for initialization
	void Start () {
	
	}

    void LateUpdate()
    {
        bloom_intensity = 0.0f;
        foreach (GameObject g in GameObject.FindGameObjectsWithTag("wavelane"))
        {
            bloom_intensity += g.GetComponent<MeshWave>().RMS;
        }
        GetComponent<BloomAndFlares>().bloomIntensity = 0.8f + bloom_intensity*1.8f;
    }

}
