Mudar a unidade de cor ao longo do tempo
void Start()
{
// ... your other stuff
StartCoroutine(ChangeEngineColour());
}
private IEnumerator ChangeEngineColour()
{
float tick = 0f;
while (engineBodyRenderer.material.color != endColor)
{
tick += Time.deltaTime * speed;
engineBodyRenderer.material.color = Color.Lerp(startColor, endColor, tick);
yield return null;
}
}
M K