protected void Update()
{
if (Time.time - time > delay)
{
mat.SetTexture(BLEND_VALUE_NAME, textures[texIndex]);
time = Time.time;
delay = Random.Range(minRandomVal, maxRandomVal);
int curIndex = texIndex;
while (texIndex == curIndex)
{
texIndex = Random.Range(0, textures.Length);
}
}
}