void Update(){
if (PulsateGrid) {
if (pulseUp) {
if (currentTime01 < pulseTime) {
currentTime01 += Time.unscaledDeltaTime;
float lerp = currentTime01 / pulseTime;
gridImage.color = Color.Lerp (startColor, pulseColor, lerp);
} else {
currentTime01 = 0.0f;
pulseUp = false;
}
} else {
if (currentTime01 < pulseTime) {
currentTime01 += Time.unscaledDeltaTime;
float lerp = currentTime01 / pulseTime;
gridImage.color = Color.Lerp (pulseColor, startColor, lerp);
} else {
currentTime01 = 0.0f;
pulseUp = true;
PulsateGrid = false;
}
}
}
}
}