using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Control_Sky : MonoBehaviour {
public Material[] materials;
public float[] times;
public Color color;
public Color color2;
public Light light;
IEnumerator sky (){
yield return new WaitForSeconds(times[0]);
RenderSettings.skybox = materials[1];
light.color = color;
yield return new WaitForSeconds(times[1]);
RenderSettings.skybox = materials[2];
light.color = color;
yield return new WaitForSeconds(times[2]);
RenderSettings.skybox = materials[3];
light.color = color;
yield return new WaitForSeconds(times[3]);
RenderSettings.skybox = materials[4];
light.color = color2;
yield return new WaitForSeconds(times[4]);
RenderSettings.skybox = materials[5];
light.color = color2;
yield return new WaitForSeconds(times[5]);
RenderSettings.skybox = materials[6];
light.color = color2;
yield return new WaitForSeconds(times[6]);
RenderSettings.skybox = materials[0];
light.color = color;
}
void Start()
{
RenderSettings.skybox = materials[0];
light.color = color;
}
void Update()
{
StartCoroutine(sky());
}
}