Код: Выделить всё
gameObject.GetComponent().material.color = Color.red;
Код: Выделить всё
gameObject.GetComponent().material.SetColor("_Color", Color.red);
Подробнее здесь: https://stackoverflow.com/questions/363 ... sh-by-code
Код: Выделить всё
gameObject.GetComponent().material.color = Color.red;
Код: Выделить всё
gameObject.GetComponent().material.SetColor("_Color", Color.red);