|
|
|
|
|
|
private IEnumerator FadeCoroutine(bool fadeIn, float duration, Color endColor = default) |
|
|
|
{ |
|
|
|
Color startColor = _imageComponent.color; |
|
|
|
if (fadeIn) endColor = Color.clear; |
|
|
|
if (fadeIn) |
|
|
|
endColor = Color.clear; |
|
|
|
|
|
|
|
float totalTime = 0f; |
|
|
|
|
|
|
|
|
|
|
_imageComponent.color = Color.Lerp(startColor, endColor, totalTime/duration); |
|
|
|
_imageComponent.color = Color.Lerp(startColor, endColor, totalTime / duration); |
|
|
|
|
|
|
|
yield return null; |
|
|
|
} |
|
|
|