// Token: 0x06000BF4 RID: 3060 RVA: 0x0003A450 File Offset: 0x00038650
        private void Update()
        {
            if (Time.deltaTime == 0f)
            {
                return;
            }
            if (this.target != this.previousTarget)
            {
                this.previousTarget = this.target;
                Action <CameraRigController, GameObject> action = CameraRigController.onCameraTargetChanged;
                if (action != null)
                {
                    action(this, this.target);
                }
            }
            this.lerpCameraTime   += Time.deltaTime * this.lerpCameraTimeScale;
            this.firstPersonTarget = null;
            float num = this.baseFov;

            this.sceneCam.rect = this.viewport;
            Player      player      = null;
            UserProfile userProfile = null;
            bool        flag        = false;

            if (this.viewer && this.viewer.localUser != null)
            {
                player      = this.viewer.localUser.inputPlayer;
                userProfile = this.viewer.localUser.userProfile;
                flag        = this.viewer.localUser.isUIFocused;
            }
            if (this.cameraMode == CameraRigController.CameraMode.SpectateUser && player != null)
            {
                if (player.GetButtonDown("PrimarySkill"))
                {
                    this.target = CameraRigController.GetNextSpectateGameObject(this.viewer, this.target);
                }
                if (player.GetButtonDown("SecondarySkill"))
                {
                    this.target = CameraRigController.GetPreviousSpectateGameObject(this.viewer, this.target);
                }
            }
            LocalUser     localUserViewer = this.localUserViewer;
            MPEventSystem mpeventSystem   = (localUserViewer != null) ? localUserViewer.eventSystem : null;
            float         num14;
            float         num15;

            if ((!mpeventSystem || !mpeventSystem.isCursorVisible) && player != null && userProfile != null && !flag && this.overrideCam == null)
            {
                float   mouseLookSensitivity = userProfile.mouseLookSensitivity;
                float   num2 = userProfile.stickLookSensitivity * CameraRigController.aimStickGlobalScale.value * 45f;
                Vector2 vector = new Vector2(player.GetAxisRaw(2), player.GetAxisRaw(3));
                Vector2 vector2 = new Vector2(player.GetAxisRaw(16), player.GetAxisRaw(17));
                CameraRigController.< Update > g__ConditionalNegate | 69_0 (ref vector.x, userProfile.mouseLookInvertX);
                CameraRigController.< Update > g__ConditionalNegate | 69_0 (ref vector.y, userProfile.mouseLookInvertY);
                CameraRigController.< Update > g__ConditionalNegate | 69_0 (ref vector2.x, userProfile.stickLookInvertX);
                CameraRigController.< Update > g__ConditionalNegate | 69_0 (ref vector2.y, userProfile.stickLookInvertY);
                float magnitude = vector2.magnitude;
                float num3      = magnitude;
                this.aimStickPostSmoothing = Vector2.zero;
                this.aimStickPostDualZone  = Vector2.zero;
                this.aimStickPostExponent  = Vector2.zero;
                if (CameraRigController.aimStickDualZoneSmoothing.value != 0f)
                {
                    float maxDelta = Time.deltaTime / CameraRigController.aimStickDualZoneSmoothing.value;
                    num3 = Mathf.Min(Mathf.MoveTowards(this.stickAimPreviousAcceleratedMagnitude, magnitude, maxDelta), magnitude);
                    this.stickAimPreviousAcceleratedMagnitude = num3;
                    this.aimStickPostSmoothing = ((magnitude != 0f) ? (vector2 * (num3 / magnitude)) : Vector2.zero);
                }
                float num4  = num3;
                float value = CameraRigController.aimStickDualZoneSlope.value;
                float num5;
                if (num4 <= CameraRigController.aimStickDualZoneThreshold.value)
                {
                    num5 = 0f;
                }
                else
                {
                    num5 = 1f - value;
                }
                num3 = value * num4 + num5;
                this.aimStickPostDualZone = ((magnitude != 0f) ? (vector2 * (num3 / magnitude)) : Vector2.zero);
                num3 = Mathf.Pow(num3, CameraRigController.aimStickExponent.value);
                this.aimStickPostExponent = ((magnitude != 0f) ? (vector2 * (num3 / magnitude)) : Vector2.zero);
                if (magnitude != 0f)
                {
                    vector2 *= num3 / magnitude;
                }
                if (this.cameraMode == CameraRigController.CameraMode.PlayerBasic && this.targetBody && !this.targetBody.isSprinting)
                {
                    AimAssistTarget exists     = null;
                    AimAssistTarget exists2    = null;
                    float           value2     = CameraRigController.aimStickAssistMinSize.value;
                    float           num6       = value2 * CameraRigController.aimStickAssistMaxSize.value;
                    float           value3     = CameraRigController.aimStickAssistMaxSlowdownScale.value;
                    float           value4     = CameraRigController.aimStickAssistMinSlowdownScale.value;
                    float           num7       = 0f;
                    float           value5     = 0f;
                    float           num8       = 0f;
                    Vector2         v          = Vector2.zero;
                    Vector2         zero       = Vector2.zero;
                    Vector2         normalized = vector2.normalized;
                    Vector2         vector3    = new Vector2(0.5f, 0.5f);
                    for (int i = 0; i < AimAssistTarget.instancesList.Count; i++)
                    {
                        AimAssistTarget aimAssistTarget = AimAssistTarget.instancesList[i];
                        if (aimAssistTarget.teamComponent.teamIndex != this.targetTeamIndex)
                        {
                            Vector3 vector4 = this.sceneCam.WorldToViewportPoint(aimAssistTarget.point0.position);
                            Vector3 vector5 = this.sceneCam.WorldToViewportPoint(aimAssistTarget.point1.position);
                            float   num9    = Mathf.Lerp(vector4.z, vector5.z, 0.5f);
                            if (num9 > 3f)
                            {
                                float   num10   = 1f / num9;
                                Vector2 vector6 = Util.ClosestPointOnLine(vector4, vector5, vector3) - vector3;
                                float   num11   = Mathf.Clamp01(Util.Remap(vector6.magnitude, value2 * aimAssistTarget.assistScale * num10, num6 * aimAssistTarget.assistScale * num10, 1f, 0f));
                                float   num12   = Mathf.Clamp01(Vector3.Dot(vector6, vector2.normalized));
                                float   num13   = num12 * num11;
                                if (num7 < num11)
                                {
                                    num7    = num11;
                                    exists2 = aimAssistTarget;
                                }
                                if (num13 > num8)
                                {
                                    num7   = num11;
                                    value5 = num12;
                                    exists = aimAssistTarget;
                                    v      = vector6;
                                }
                            }
                        }
                    }
                    Vector2 vector7 = vector2;
                    if (exists2)
                    {
                        float magnitude2 = vector2.magnitude;
                        float d          = Mathf.Clamp01(Util.Remap(1f - num7, 0f, 1f, value3, value4));
                        vector7 *= d;
                    }
                    if (exists)
                    {
                        vector7 = Vector3.RotateTowards(vector7, v, Util.Remap(value5, 1f, 0f, CameraRigController.aimStickAssistMaxDelta.value, CameraRigController.aimStickAssistMinDelta.value), 0f);
                    }
                    vector2 = vector7;
                }
                num14 = vector.x * mouseLookSensitivity * userProfile.mouseLookScaleX + vector2.x * num2 * userProfile.stickLookScaleX * Time.deltaTime;
                num15 = vector.y * mouseLookSensitivity * userProfile.mouseLookScaleY + vector2.y * num2 * userProfile.stickLookScaleY * Time.deltaTime;
            }
            else
            {
                num14 = 0f;
                num15 = 0f;
            }
            NetworkUser         networkUser         = Util.LookUpBodyNetworkUser(this.target);
            NetworkedViewAngles networkedViewAngles = null;

            if (networkUser)
            {
                networkedViewAngles = networkUser.GetComponent <NetworkedViewAngles>();
            }
            this.targetTeamIndex = TeamIndex.None;
            bool flag2 = false;

            if (this.target)
            {
                this.targetBody = this.target.GetComponent <CharacterBody>();
                flag2           = this.targetBody.isSprinting;
                TeamComponent component = this.target.GetComponent <TeamComponent>();
                if (component)
                {
                    this.targetTeamIndex = component.teamIndex;
                }
                this.targetParams = this.target.GetComponent <CameraTargetParams>();
            }
            Vector3 vector8 = this.desiredCameraState.position;

            if (this.targetParams)
            {
                Vector3 position            = this.target.transform.position;
                Vector3 cameraPivotPosition = this.targetParams.cameraPivotPosition;
                if (this.targetParams.dontRaycastToPivot)
                {
                    vector8 = cameraPivotPosition;
                }
                else
                {
                    Vector3 direction = cameraPivotPosition - position;
                    Ray     ray       = new Ray(position, direction);
                    float   distance  = this.Raycast(ray, direction.magnitude, this.targetParams.cameraParams.wallCushion);
                    vector8 = ray.GetPoint(distance);
                }
            }
            if (this.cameraMode == CameraRigController.CameraMode.PlayerBasic || this.cameraMode == CameraRigController.CameraMode.SpectateUser)
            {
                float   min = -89.9f;
                float   max = 89.9f;
                Vector3 idealLocalCameraPos = new Vector3(0f, 0f, 0f);
                float   wallCushion         = 0.1f;
                Vector2 vector9             = Vector2.zero;
                if (this.targetParams)
                {
                    min = this.targetParams.cameraParams.minPitch;
                    max = this.targetParams.cameraParams.maxPitch;
                    idealLocalCameraPos = this.targetParams.idealLocalCameraPos;
                    wallCushion         = this.targetParams.cameraParams.wallCushion;
                    vector9             = this.targetParams.recoil;
                    if (this.targetParams.aimMode == CameraTargetParams.AimType.FirstPerson)
                    {
                        this.firstPersonTarget = this.target;
                    }
                    if (this.targetParams.fovOverride >= 0f)
                    {
                        num    = this.targetParams.fovOverride;
                        num14 *= num / this.baseFov;
                        num15 *= num / this.baseFov;
                    }
                    if (this.targetBody && flag2)
                    {
                        num14 *= 0.5f;
                        num15 *= 0.5f;
                    }
                }
                if (this.sprintingParticleSystem)
                {
                    ParticleSystem.MainModule main = this.sprintingParticleSystem.main;
                    if (flag2)
                    {
                        main.loop = true;
                        if (!this.sprintingParticleSystem.isPlaying)
                        {
                            this.sprintingParticleSystem.Play();
                        }
                    }
                    else
                    {
                        main.loop = false;
                    }
                }
                if (this.cameraMode == CameraRigController.CameraMode.PlayerBasic)
                {
                    float num16 = this.pitch - num15;
                    float num17 = this.yaw + num14;
                    num16     += vector9.y;
                    num17     += vector9.x;
                    this.pitch = Mathf.Clamp(num16, min, max);
                    this.yaw   = Mathf.Repeat(num17, 360f);
                }
                else if (this.cameraMode == CameraRigController.CameraMode.SpectateUser && this.target)
                {
                    if (networkedViewAngles)
                    {
                        this.SetPitchYaw(networkedViewAngles.viewAngles);
                    }
                    else
                    {
                        InputBankTest component2 = this.target.GetComponent <InputBankTest>();
                        if (component2)
                        {
                            this.SetPitchYawFromLookVector(component2.aimDirection);
                        }
                    }
                }
                this.desiredCameraState.rotation = Quaternion.Euler(this.pitch, this.yaw, 0f);
                Vector3 direction2 = vector8 + this.desiredCameraState.rotation * idealLocalCameraPos - vector8;
                float   num18      = direction2.magnitude;
                float   num19      = (1f + this.pitch / -90f) * 0.5f;
                num18 *= Mathf.Sqrt(1f - num19);
                if (num18 < 0.25f)
                {
                    num18 = 0.25f;
                }
                float a = this.Raycast(new Ray(vector8, direction2), num18, wallCushion);
                this.currentCameraDistance       = Mathf.Min(a, Mathf.SmoothDamp(this.currentCameraDistance, a, ref this.cameraDistanceVelocity, 0.5f));
                this.desiredCameraState.position = vector8 + direction2.normalized * this.currentCameraDistance;
                this.pitch -= vector9.y;
                this.yaw   -= vector9.x;
                if (networkedViewAngles && networkedViewAngles.hasEffectiveAuthority)
                {
                    networkedViewAngles.viewAngles = new PitchYawPair(this.pitch, this.yaw);
                }
            }
            if (this.targetBody)
            {
                num *= (this.targetBody.isSprinting ? 1.3f : 1f);
            }
            this.desiredCameraState.fov = Mathf.SmoothDamp(this.desiredCameraState.fov, num, ref this.fovVelocity, 0.2f, float.PositiveInfinity, Time.deltaTime);
            if (this.hud)
            {
                CharacterMaster targetMaster = this.targetBody ? this.targetBody.master : null;
                this.hud.targetMaster = targetMaster;
            }
            this.UpdateCrosshair(vector8);
            CameraState cameraState = this.desiredCameraState;

            if (this.overrideCam != null)
            {
                if ((UnityEngine.Object) this.overrideCam)
                {
                    cameraState = this.overrideCam.GetCameraState(this);
                }
                this.overrideCam = null;
            }
            if (this.lerpCameraTime >= 1f)
            {
                this.currentCameraState = cameraState;
            }
            else
            {
                this.currentCameraState = CameraState.Lerp(ref this.lerpCameraState, ref cameraState, CameraRigController.RemapLerpTime(this.lerpCameraTime));
            }
            this.SetCameraState(this.currentCameraState);
        }