What do you mean? I haven’t assigned my sky box texture materials because my script is broken. The missing textures don’t appear to be the problem, but rather how my code is written.
Thank you for all your replies. The code now reads as follows:
using UnityEngine;
using System.Collections;
public class SkyboxCycle : MonoBehaviour {
public Material nightMat;
public Material dayMat;
void Update () {
changeSky();
}
private static void changeSky()
{
var hours = System.DateTime.Now.Hour;
if(hours >= 18 && hours <= 24)
{
RenderSettings.skybox = nightMat;
}
else
{
RenderSettings.skybox = dayMat;
}
}
}
The console in Unity is saying
Assets/Scripts/SkyboxCycle.cs(19,33): error CS0120: An object reference is required to access non-static member `SkyboxCycle.nightMat’
Assets/Scripts/SkyboxCycle.cs(23,33): error CS0120: An object reference is required to access non-static member `SkyboxCycle.dayMat’
So my question now is, “How do I manually reference the location of my two skybox materials?” My material are located in /Assets/Sky in my project folder.