2014-11-09 19:21:28 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
|
|
public class Clock : MonoBehaviour {
|
|
|
|
|
|
|
|
|
|
public GameObject clock;
|
|
|
|
|
|
|
|
|
|
// Use this for initialization
|
|
|
|
|
void Start () {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
void Update () {
|
|
|
|
|
//TODO: Sync clock with the server
|
|
|
|
|
//TODO: Set var as for day % or hour
|
|
|
|
|
|
|
|
|
|
float fRot = clock.transform.rotation.z;
|
|
|
|
|
|
|
|
|
|
if(fRot>=0 && fRot<180){
|
2015-01-21 23:09:21 +00:00
|
|
|
|
clock.transform.Rotate(0, 0, (float)(Time.deltaTime * (-180.0)/150.0));//2.5min
|
2014-11-09 19:21:28 +00:00
|
|
|
|
}
|
|
|
|
|
else{
|
2015-01-21 23:09:21 +00:00
|
|
|
|
clock.transform.Rotate(0, 0, (float)(Time.deltaTime * (-180.0)/60.0));//1min
|
2014-11-09 19:21:28 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|