From 68b5175a3727af6a89df4acb7a8fc5aed1b98fe4 Mon Sep 17 00:00:00 2001 From: nlitkowski Date: Mon, 20 Dec 2021 00:12:11 +0100 Subject: [PATCH] Remove redundant code --- SW-Unity/Assets/Scripts/Main.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SW-Unity/Assets/Scripts/Main.cs b/SW-Unity/Assets/Scripts/Main.cs index efa3ebc5..e3422f7c 100644 --- a/SW-Unity/Assets/Scripts/Main.cs +++ b/SW-Unity/Assets/Scripts/Main.cs @@ -202,11 +202,11 @@ public class Main : MonoBehaviour [System.Diagnostics.CodeAnalysis.SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Unity method")] void Update() { - Vector3 lookAt = new Vector3(500f + m_camLookAtX, 1f + m_camLookAtY, 500f + m_camLookAtZ); newCameraPosX = m_CameraR * Mathf.Cos(camera_rotation) + 500f + m_camPosX; newCameraPosY = 10f + m_camPosY; newCameraPosZ = m_CameraR * Mathf.Sin(camera_rotation) + 500f + m_camPosZ; Vector3 pos = new Vector3(newCameraPosX, newCameraPosY, newCameraPosZ); + Vector3 lookAt = new Vector3(500f + m_camLookAtX, 1f + m_camLookAtY, 500f + m_camLookAtZ); mainCamera.GetComponent().fieldOfView = m_FieldOfView; mainCamera.GetComponent().transform.position = pos; @@ -229,8 +229,8 @@ public class Main : MonoBehaviour directionalLight.GetComponent().intensity = m_LightIntensity; textureCamera.GetComponent().fieldOfView = m_FieldOfView; - textureCamera.GetComponent().transform.position = new Vector3(newCameraPosX, newCameraPosY, newCameraPosZ); - textureCamera.GetComponent().transform.LookAt(new Vector3(500f + m_camLookAtX, 1f + m_camLookAtY, 500f + m_camLookAtZ)); + textureCamera.GetComponent().transform.position = pos; + textureCamera.GetComponent().transform.LookAt(lookAt); //textureCamera.transform.RotateAround(new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f), 1); }