private void Update() { if (rotating) { return; } Vector3 localMovement = new Vector2(); if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow)) { localMovement.z += panSpeed; } if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow)) { localMovement.z -= panSpeed; } if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow)) { localMovement.x -= panSpeed; } if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow)) { localMovement.x += panSpeed; } Vector3 worldMovement = transform.TransformDirection(localMovement); transform.position = MathfExtensions.Clamp(worldMovement + transform.position, minCamera, maxCamera); if (Input.GetKeyDown(KeyCode.Q)) { Rotate(-90); } if (Input.GetKeyDown(KeyCode.E)) { Rotate(90); } if (Input.mouseScrollDelta.y > 0 || Input.GetKeyDown(KeyCode.R) || Input.GetKeyDown(KeyCode.Plus) || Input.GetKeyDown(KeyCode.KeypadPlus)) { Zoom(-zoomAmount); } if (Input.mouseScrollDelta.y < 0 || Input.GetKeyDown(KeyCode.F) || Input.GetKeyDown(KeyCode.Minus) || Input.GetKeyDown(KeyCode.KeypadMinus)) { Zoom(zoomAmount); } }