private Vector3 PreserveLignOfSight(ref CameraState state, ref CinemachineCollider.VcamExtraState extra)
        {
            Vector3 result = Vector3.zero;

            if (state.HasLookAt)
            {
                Vector3 correctedPosition = state.CorrectedPosition;
                Vector3 referenceLookAt   = state.ReferenceLookAt;
                Vector3 vector            = correctedPosition;
                Vector3 vector2           = vector - referenceLookAt;
                float   magnitude         = vector2.magnitude;
                float   num = Mathf.Max(this.m_MinimumDistanceFromTarget, 0.0001f);
                if (magnitude > num)
                {
                    vector2.Normalize();
                    float num2 = magnitude - num;
                    if (this.m_DistanceLimit > 0.0001f)
                    {
                        num2 = Mathf.Min(this.m_DistanceLimit, num2);
                    }
                    Ray ray = new Ray(vector - num2 * vector2, vector2);
                    num2 += 0.001f;
                    RaycastHit obstacle;
                    if (num2 > 0.0001f && this.RaycastIgnoreTag(ray, out obstacle, num2))
                    {
                        float distance = Mathf.Max(0f, obstacle.distance - 0.001f);
                        vector = ray.GetPoint(distance);
                        extra.AddPointToDebugPath(vector);
                        if (this.m_Strategy != CinemachineCollider.ResolutionStrategy.PullCameraForward)
                        {
                            vector = this.PushCameraBack(vector, vector2, obstacle, referenceLookAt, new Plane(state.ReferenceUp, correctedPosition), magnitude, this.m_MaximumEffort, ref extra);
                        }
                    }
                }
                if (this.m_CameraRadius > 0.0001f)
                {
                    vector += this.RespectCameraRadius(vector, state.ReferenceLookAt);
                }
                else if (this.mCameraColliderGameObject != null)
                {
                    this.CleanupCameraCollider();
                }
                result = vector - correctedPosition;
            }
            return(result);
        }
        private Vector3 PushCameraBack(Vector3 currentPos, Vector3 pushDir, RaycastHit obstacle, Vector3 lookAtPos, Plane startPlane, float targetDistance, int iterations, ref CinemachineCollider.VcamExtraState extra)
        {
            Vector3 vector = Vector3.zero;

            if (!this.GetWalkingDirection(currentPos, pushDir, obstacle, ref vector))
            {
                return(currentPos);
            }
            Ray   ray = new Ray(currentPos, vector);
            float num = this.GetPushBackDistance(ray, startPlane, targetDistance, lookAtPos);

            if (num <= 0.0001f)
            {
                return(currentPos);
            }
            float num2 = this.ClampRayToBounds(ray, num, obstacle.collider.bounds);

            num = Mathf.Min(num, num2 + 0.001f);
            RaycastHit obstacle2;
            Vector3    vector2;

            if (this.RaycastIgnoreTag(ray, out obstacle2, num))
            {
                float distance = obstacle2.distance - 0.001f;
                vector2 = ray.GetPoint(distance);
                extra.AddPointToDebugPath(vector2);
                if (iterations > 1)
                {
                    vector2 = this.PushCameraBack(vector2, vector, obstacle2, lookAtPos, startPlane, targetDistance, iterations - 1, ref extra);
                }
                return(vector2);
            }
            vector2 = ray.GetPoint(num);
            vector  = vector2 - lookAtPos;
            float      magnitude = vector.magnitude;
            RaycastHit raycastHit;

            if (magnitude < 0.0001f || this.RaycastIgnoreTag(new Ray(lookAtPos, vector), out raycastHit, magnitude - 0.001f))
            {
                return(currentPos);
            }
            ray = new Ray(vector2, vector);
            extra.AddPointToDebugPath(vector2);
            num = this.GetPushBackDistance(ray, startPlane, targetDistance, lookAtPos);
            if (num > 0.0001f)
            {
                if (!this.RaycastIgnoreTag(ray, out obstacle2, num))
                {
                    vector2 = ray.GetPoint(num);
                    extra.AddPointToDebugPath(vector2);
                }
                else
                {
                    float distance2 = obstacle2.distance - 0.001f;
                    vector2 = ray.GetPoint(distance2);
                    extra.AddPointToDebugPath(vector2);
                    if (iterations > 1)
                    {
                        vector2 = this.PushCameraBack(vector2, vector, obstacle2, lookAtPos, startPlane, targetDistance, iterations - 1, ref extra);
                    }
                }
            }
            return(vector2);
        }