- Home /
Need help with 24 Hour timing script.
Im not asking anyone to write a code for me before anyone thinks this, I already have a timing script that counts the hours and resets at hour 23 to 0.
Im asking for what the code snippets for changing the scenes ambient lighting and skybox setting, so I can insert them at appropriate times for the times of the day.
I dont know them
var Hour = 0;
function Start () {
InvokeRepeating("time", 0, 60);
}
function time () {
Hour = Hour + 1;
}
function Update () {
if(Hour > 23){
Hour = 0;
}
guiText.text = ("Hour:"+Hour);
}
this is the code for anyone wondering.
Answer by corriedotdev · Apr 06, 2014 at 11:08 PM
This pretty much does all the sky and clouds animation all in one amazing package:
http://www.pixelstudio.nl/?p=138
Here is a link to the sun light wiki page, has some stuff about changing the light and colour of the sun:
http://unifycommunity.com/wiki/index.php?title=SunLight
This one is a link to the skybox blend wiki page:
http://www.unifycommunity.com/wiki/index.php?title=SkyboxBlended
This guy is selling a tutorial all about making a day/night cycle:
http://forum.unity3d.com/viewtopic.php?t=51106&highlight=night+cycle
Thanks to spinal jack for the links to these resources.
Your answer
Follow this Question
Related Questions
RenderSettings.ambientProbe "empty", how to access? 0 Answers
Enviroment Lighting from Sky not updating in realtime 0 Answers
Unity5: Changing AmbientSkyColor doesn't change Skybox Color 2 Answers
[SOLVED] In which GI lighting modes are different light probes/maps used? 1 Answer
How can I hide HDRI skybox view from my game view but still get its lighting features in realtime? 1 Answer