I have the following script segment in my day and night cycle I have been working on but instead it just jumping form SunRiseColor to normalColor I want it to blend to that color as it goes or change shades till it gets there. The _timeOfDay is my day code that its basing when do do each at. Right now I am doing sunRiseColor and sunRise2Color because I could not get a blend.
private void AdjustColor()
{
for(int cnt = 0; cnt < _sunScript.Length; cnt++)
{
if(_timeOfDay >20 && _timeOfDay < 38)
{
_sunScript[cnt].GetComponent<Light>().color = sunRiseColor;
_sunScript[cnt].GetComponent<LensFlare>().color = sunRiseColor;
}
if(_timeOfDay >38 && _timeOfDay < 40)
{
_sunScript[cnt].GetComponent<Light>().color = sunRise2Color;
_sunScript[cnt].GetComponent<LensFlare>().color = sunRise2Color;
}
if(_timeOfDay > 75 && _timeOfDay < 85)
{
_sunScript[cnt].GetComponent<Light>().color = sunSetColor;
_sunScript[cnt].GetComponent<LensFlare>().color = sunSetColor;
}
if(_timeOfDay > 85 && _timeOfDay < 100)
{
_sunScript[cnt].GetComponent<Light>().color = sunSet2Color;
_sunScript[cnt].GetComponent<LensFlare>().color = sunSet2Color;
}
if(_timeOfDay > 40 && _timeOfDay < 75)
{
_sunScript[cnt].GetComponent<Light>().color = normalColor;
_sunScript[cnt].GetComponent<LensFlare>().color = normalColor;
}
}
}