public WarBoardCamera() { this.cameraGameObject = new GameObject("WarboardCamera"); this.cameraGameObject.transform.position = this.warboardCameraPosFromUnity; this.cameraGameObject.transform.position += new Vector3(-10000f, -10000f, 0f); this.cameraGameObject.transform.localEulerAngles = this.warboardCameraRotation; this.unityCamera = this.cameraGameObject.AddComponent <Camera>(); this.unityCamera.clearFlags = CameraClearFlags.Color; this.unityCamera.backgroundColor = Color.black; this.unityCamera.depth = -1f; this.unityCamera.orthographic = false; this.unityCamera.fieldOfView = 20f; this.unityCamera.nearClipPlane = 20f; this.unityCamera.farClipPlane = 1500f; this.unityCamera.useOcclusionCulling = false; this.unityCamera.allowHDR = false; base.GroundOffset = 0f; this.distanceFromEyeToScreen = CameraUtils.CalculateDistanceFromEyeToScreen(this.unityCamera); base.Disable(); }
public void OnScreenSizeChange() { this.distanceFromEyeToScreen = CameraUtils.CalculateDistanceFromEyeToScreen(this.unityCamera); }