I`ve made a simple code, that changes tint color during the time, and it works fine when
line that changes color is like that: renderer.material.SetColor(“_TintColor”,Color.magenta);
But it works not right if i change color like this:
public class RenderColorTest : MonoBehaviour
{
public float Timer = 1f;
Color colorBlue;
// Use this for initialization
void Start ()
{
colorBlue.r = 0;
colorBlue.g = 105;
colorBlue.b = 255;
colorBlue.a = 128;
}
// Update is called once per frame
void Update ()
{
Timer -= Time.deltaTime;
if(Timer < 0)
renderer.material.SetColor("_TintColor",colorBlue);
}
}
Thanks for any help!