postprocessing options (1)

This commit is contained in:
mangorifo
2024-01-31 22:53:00 +08:00
parent 64fbc0031a
commit 2951c4d538
310 changed files with 2144 additions and 143 deletions
Executable file → Normal file
+15 -5
View File
@@ -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;