change color of sprite unity code example
Example 1: change olour in unity script
SpriteRenderer sr;
void Start()
{
sr = GetComponent();
}
void Update()
{
//This is a simple way of adding color
sr.color = Color.red;
//This is a more specific way of adding color
sr.color = new Color(0/*Red*/,0/*Green*/,0/*Blue*/)
}
Example 2: change sprite color unity
sprite.color = new Color (1, 0, 0, 1);