using UnityEngine;

public class ChangeColor : MonoBehaviour {

    private Material[] mats;

	void Start () {
        mats = GetComponent<Renderer>().materials;
        InvokeRepeating("ChangeFadeToColor", 0, RandomColor.delayBetweenColors);
    }

	void ChangeFadeToColor () {
        for(int i = 0; i < mats.Length; i++) {
            mats[i].color = new Color(Random.value, Random.value, Random.value);
        }
    }
}