Fixed day/night cycle

This commit is contained in:
Thomas Abot 2015-03-08 15:03:07 +01:00
parent 1ff10a02b8
commit 9e6b2dd406
2 changed files with 3 additions and 2 deletions

View File

@ -21168,6 +21168,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
targetPos: {x: 0, y: 0, z: 0}
targetRot: {x: 0, y: 0, z: 0, w: 0}
initLocation: {fileID: 717116040}
--- !u!81 &1859570686
AudioListener:
m_ObjectHideFlags: 0

View File

@ -25,9 +25,9 @@ public class Clock : MonoBehaviour {
//TODO: Sync clock with the server
//TODO: Set var as for day % or hour
float fRot = clock.transform.rotation.z;
float fRot = clock.transform.rotation.eulerAngles.z;
if(fRot>=0 && fRot>-180) {
if(fRot>=180) {
clock.transform.Rotate(0, 0, (float)(Time.deltaTime * (-180.0)/maxNight));//2.5min
}
else {