simple eating )

This commit is contained in:
2023-02-28 23:41:38 +02:00
parent 75b9665674
commit 811b2efc85
9 changed files with 55 additions and 252 deletions
+5 -5
View File
@@ -8,8 +8,8 @@ public class TimeManager : MonoBehaviour
[SerializeField]
private float _startHour;
[SerializeField]
private Light _sunLight;
//[SerializeField]
//private Light _sunLight;
[SerializeField]
private float _sunriseHour;
@@ -31,7 +31,7 @@ public class TimeManager : MonoBehaviour
// Start is called before the first frame update
void Start()
{
_sunInitialIntensity = _sunLight.intensity;
// _sunInitialIntensity = _sunLight.intensity;
_timer = _minuteToRealTime;
_currentTime = TimeSpan.Zero + TimeSpan.FromHours(_startHour);
_sunriseTime = TimeSpan.FromHours(_sunriseHour);
@@ -61,7 +61,7 @@ public class TimeManager : MonoBehaviour
{
float intensityMultiplier = 1;
float timeofDay = (float)(CurrentTime.TotalDays - CurrentTime.Days);
_sunLight.transform.localRotation = Quaternion.Euler((timeofDay * 360f) - 90, 170, 0);
//_sunLight.transform.localRotation = Quaternion.Euler((timeofDay * 360f) - 90, 170, 0);
if (timeofDay > _sunriseTime.TotalDays && timeofDay < _sunsetTime.TotalDays)
{
if (timeofDay <= _sunsetTime.TotalDays)
@@ -73,7 +73,7 @@ public class TimeManager : MonoBehaviour
{
intensityMultiplier = 0;
}
_sunLight.intensity = _sunInitialIntensity * intensityMultiplier;
// _sunLight.intensity = _sunInitialIntensity * intensityMultiplier;
}
private TimeSpan CalculateTimeDifference(TimeSpan from, TimeSpan to)