diff --git a/Assets/Scripts/Behaviours/World/Cell.cs b/Assets/Scripts/Behaviours/World/Cell.cs index 5eb215df..eed76ab5 100644 --- a/Assets/Scripts/Behaviours/World/Cell.cs +++ b/Assets/Scripts/Behaviours/World/Cell.cs @@ -60,10 +60,13 @@ namespace SanAndreasUnity.Behaviours.World public GameObject lightSourcePrefab; public float lightScaleMultiplier = 1f; + public float redTrafficLightDuration = 7; public float yellowTrafficLightDuration = 2; public float greenTrafficLightDuration = 7; + public bool rotateLightsToFaceCamera = true; + private void Awake() diff --git a/Assets/Scripts/Behaviours/World/StaticGeometry.cs b/Assets/Scripts/Behaviours/World/StaticGeometry.cs index 3329c35c..0b3c41bb 100644 --- a/Assets/Scripts/Behaviours/World/StaticGeometry.cs +++ b/Assets/Scripts/Behaviours/World/StaticGeometry.cs @@ -381,13 +381,15 @@ namespace SanAndreasUnity.Behaviours.World private void UpdateLights() { - var cam = Camera.current; - - if (cam != null) + if (Cell.Instance.rotateLightsToFaceCamera) { - for (int i = 0; i < m_lightSources.Length; i++) + var cam = Camera.current; + if (cam != null) { - m_lightSources[i].transform.forward = -cam.transform.forward; + for (int i = 0; i < m_lightSources.Length; i++) + { + m_lightSources[i].transform.forward = -cam.transform.forward; + } } }