postprocessing options (1)
This commit is contained in:
Executable file → Normal file
+15
-5
@@ -9,6 +9,8 @@ public class TimeController : MonoBehaviour
|
||||
{
|
||||
public TMP_Text TODIndicator;
|
||||
public Slider TODSlider;
|
||||
public bool UseLocalTime = false;
|
||||
|
||||
[HideInInspector]
|
||||
public GameObject sun;
|
||||
[HideInInspector]
|
||||
@@ -46,15 +48,23 @@ public class TimeController : MonoBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
SunUpdate();
|
||||
if (UseLocalTime)
|
||||
{
|
||||
timeOfDay = DateTime.Now.Hour + (DateTime.Now.Minute * 0.01f);
|
||||
SunUpdate();
|
||||
}
|
||||
else
|
||||
{
|
||||
SunUpdate();
|
||||
timeOfDay += (Time.deltaTime / secondsPerDay) * timeMultiplier;
|
||||
|
||||
if (timeOfDay >= 24)
|
||||
timeOfDay = 0;
|
||||
}
|
||||
|
||||
timeOfDay += (Time.deltaTime / secondsPerDay) * timeMultiplier;
|
||||
StringTimeOfDay = FormatTime(timeOfDay, MilitaryTime);
|
||||
PublicFormattedTimeOfDay = StringTimeOfDay;
|
||||
|
||||
if (timeOfDay >= 24)
|
||||
timeOfDay = 0;
|
||||
|
||||
|
||||
if (TODIndicator)
|
||||
TODIndicator.text = StringTimeOfDay;
|
||||
|
||||
Reference in New Issue
Block a user