/// <summary> /// Change the color of the text. /// </summary> private void ChangeColor() { text.color = Color.Lerp(startColor, targetColor, t); if (t < 1) { t += Time.deltaTime / speed; } bool exit = HeroKitCommonRuntime.DoColorsMatch(text.color, targetColor); if (exit) { enabled = false; } }