change angle of Sun around Y axis

This commit is contained in:
in0finite 2021-07-18 21:05:39 +02:00
parent f47b2adaf0
commit c30551d718

View file

@ -13,6 +13,8 @@ namespace SanAndreasUnity.Behaviours.World
public Light directionalLight;
public float lightYAngle = 45f;
public byte startTimeHours = 12;
public byte startTimeMinutes = 0;
@ -152,7 +154,8 @@ namespace SanAndreasUnity.Behaviours.World
float UpdateLightAngle(float curveTime)
{
float lightAngle = this.lightAngleCurve.Evaluate(curveTime) * 180f;
this.directionalLight.transform.rotation = Quaternion.AngleAxis(lightAngle, Vector3.right);
this.directionalLight.transform.rotation =
Quaternion.AngleAxis(lightAngle, Vector3.right) * Quaternion.AngleAxis(this.lightYAngle, Vector3.up);
return lightAngle;
}