void Update()
{
if (_delayedExplosionStarted)
{
_explodeDelay = (_explodeDelay - Time.deltaTime);
if (_explodeDelay <= 0f)
{
Explode();
}
}
//_heatwave doesn't get defined unless SystemInfo.supportsImageEffects is true, checked in Explode()
if (_heatwave)
{
// billboard it so it always faces the camera - can't use regular lookat because the built in Unity plane is lame
_heatwave.transform.rotation = Quaternion.FromToRotation(Vector3.up, Camera.main.transform.position - _heatwave.transform.position);
_heatwave.transform.localPosition = localPosition + (Vector3.forward * zOffset);
_elapsedTime = _elapsedTime + Time.deltaTime;
_normalizedTime = _elapsedTime/duration;
//thought about this, and really, the wave would move linearly, fading in amplitude.
s = Mathf.Lerp(_startSize,_maxSize,_normalizedTime);
_heatwave.renderer.material.SetFloat("_BumpAmt", ((1-_normalizedTime) * distortion));
_heatwave.gameObject.transform.localScale = new Vector3(s,s,s);
if (_elapsedTime > duration) Destroy(_heatwave.gameObject);
}
}