Hi, this is my code.
using UnityEngine;
using System.Collections;
public class NightDay : MonoBehaviour {
double count = 0;
bool didNightLast = false;
void Update () {
var day = Material;
var night = Material;
count += 0.0000000001;
if (count == 2000000) {
if (didNightLast) {
RenderSettings.skybox = day;
didNightLast = false;
} else {
RenderSettings.skybox = night;
}
count = 0;
}
}
}
I don’t get why it throws errors for the two night/day vars. Thanks in advance!