Exemple #1
0
        private Vector3[] GetPoints(float minTime, float maxTime)
        {
            List <Vector3> points = new List <Vector3>();

            if (this.m_Curve.length == 0)
            {
                return(points.ToArray());
            }
            points.Capacity = 1000 + this.m_Curve.length;
            float[,] ranges = NormalCurveRenderer.CalculateRanges(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode);
            for (int index = 0; index < ranges.GetLength(0); ++index)
            {
                this.AddPoints(ref points, ranges[index, 0], ranges[index, 1], minTime, maxTime);
            }
            if (points.Count > 0)
            {
                for (int index = 1; index < points.Count; ++index)
                {
                    if ((double)points[index].x < (double)points[index - 1].x)
                    {
                        points.RemoveAt(index);
                        --index;
                    }
                }
            }
            return(points.ToArray());
        }
        private Vector3[] GetPoints(float minTime, float maxTime)
        {
            List <Vector3> list = new List <Vector3>();

            if (this.m_Curve.length == 0)
            {
                return(list.ToArray());
            }
            list.Capacity  = 1000 + this.m_Curve.length;
            float[,] array = NormalCurveRenderer.CalculateRanges(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode);
            for (int i = 0; i < array.GetLength(0); i++)
            {
                this.AddPoints(ref list, array[i, 0], array[i, 1], minTime, maxTime);
            }
            if (list.Count > 0)
            {
                for (int j = 1; j < list.Count; j++)
                {
                    if (list[j].x < list[j - 1].x)
                    {
                        list.RemoveAt(j);
                        j--;
                    }
                }
            }
            return(list.ToArray());
        }
Exemple #3
0
        public void DrawCurve(float minTime, float maxTime, Color color, Matrix4x4 transform, int component, Color wrapColor)
        {
            if ((double)minTime < (double)this.cachedRangeStart || (double)maxTime > (double)this.cachedRangeEnd)
            {
                this.CalculateCurves(minTime, maxTime);
                if ((double)minTime <= (double)this.rangeStart && (double)maxTime >= (double)this.rangeEnd)
                {
                    this.cachedRangeStart = float.NegativeInfinity;
                    this.cachedRangeEnd   = float.PositiveInfinity;
                }
                else
                {
                    this.cachedRangeStart = minTime;
                    this.cachedRangeEnd   = maxTime;
                }
            }
            List <Vector3> vector3List = new List <Vector3>();

            using (SortedDictionary <float, Vector3> .Enumerator enumerator = this.points.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <float, Vector3> current = enumerator.Current;
                    vector3List.Add(new Vector3(current.Key, current.Value[component]));
                }
            }
            NormalCurveRenderer.DrawCurveWrapped(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode, color, transform, vector3List.ToArray(), wrapColor);
        }
Exemple #4
0
        public void DrawCurve(float minTime, float maxTime, Color color, Matrix4x4 transform, int component, Color wrapColor)
        {
            if (minTime < cachedRangeStart || maxTime > cachedRangeEnd)
            {
                CalculateCurves(minTime, maxTime);
                if (minTime <= rangeStart && maxTime >= rangeEnd)
                {
                    // if we are covering whole range
                    cachedRangeStart = Mathf.NegativeInfinity;
                    cachedRangeEnd   = Mathf.Infinity;
                }
                else
                {
                    cachedRangeStart = minTime;
                    cachedRangeEnd   = maxTime;
                }
            }

            List <Vector3> polyLine = new List <Vector3>();

            foreach (KeyValuePair <float, Vector3> kvp in points)
            {
                polyLine.Add(new Vector3(kvp.Key, kvp.Value[component]));
            }

            NormalCurveRenderer.DrawCurveWrapped(minTime, maxTime, rangeStart, rangeEnd, preWrapMode, postWrapMode, color, transform, polyLine.ToArray(), wrapColor);
        }
 private void AddPoints(ref List <Vector3> points, float minTime, float maxTime, float visibleMinTime, float visibleMaxTime)
 {
     if (this.m_Curve[0].time >= minTime)
     {
         points.Add(new Vector3(this.rangeStart, this.m_Curve[0].value));
         points.Add(new Vector3(this.m_Curve[0].time, this.m_Curve[0].value));
     }
     for (int i = 0; i < this.m_Curve.length - 1; i++)
     {
         Keyframe keyframe  = this.m_Curve[i];
         Keyframe keyframe2 = this.m_Curve[i + 1];
         if (keyframe2.time >= minTime && keyframe.time <= maxTime)
         {
             points.Add(new Vector3(keyframe.time, keyframe.value));
             int   segmentResolution = NormalCurveRenderer.GetSegmentResolution(visibleMinTime, visibleMaxTime, keyframe.time, keyframe2.time);
             float num = Mathf.Lerp(keyframe.time, keyframe2.time, 0.001f / (float)segmentResolution);
             points.Add(new Vector3(num, this.m_Curve.Evaluate(num)));
             for (float num2 = 1f; num2 < (float)segmentResolution; num2 += 1f)
             {
                 num = Mathf.Lerp(keyframe.time, keyframe2.time, num2 / (float)segmentResolution);
                 points.Add(new Vector3(num, this.m_Curve.Evaluate(num)));
             }
             num = Mathf.Lerp(keyframe.time, keyframe2.time, 1f - 0.001f / (float)segmentResolution);
             points.Add(new Vector3(num, this.m_Curve.Evaluate(num)));
             num = keyframe2.time;
             points.Add(new Vector3(num, keyframe2.value));
         }
     }
     if (this.m_Curve[this.m_Curve.length - 1].time <= maxTime)
     {
         points.Add(new Vector3(this.m_Curve[this.m_Curve.length - 1].time, this.m_Curve[this.m_Curve.length - 1].value));
         points.Add(new Vector3(this.rangeEnd, this.m_Curve[this.m_Curve.length - 1].value));
     }
 }
Exemple #6
0
 private void CalculateCurves(float minTime, float maxTime)
 {
     this.points     = new SortedDictionary <float, Vector3>();
     float[,] ranges = NormalCurveRenderer.CalculateRanges(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode);
     for (int index = 0; index < ranges.GetLength(0); ++index)
     {
         this.AddPoints(ranges[index, 0], ranges[index, 1]);
     }
 }
Exemple #7
0
 private void CalculateCurves(float minTime, float maxTime)
 {
     this.points    = new SortedDictionary <float, Vector3>();
     float[,] array = NormalCurveRenderer.CalculateRanges(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode);
     for (int i = 0; i < array.GetLength(0); i++)
     {
         this.AddPoints(array[i, 0], array[i, 1]);
     }
 }
Exemple #8
0
        private void CalculateCurves(float minTime, float maxTime)
        {
            points = new SortedDictionary <float, Vector3>();

            float[,] ranges = NormalCurveRenderer.CalculateRanges(minTime, maxTime, rangeStart, rangeEnd, preWrapMode, postWrapMode);
            for (int i = 0; i < ranges.GetLength(0); i++)
            {
                AddPoints(ranges[i, 0], ranges[i, 1]);
            }
        }
 public void DrawCurve(float minTime, float maxTime, Color color, Matrix4x4 transform, Color wrapColor)
 {
     this.BuildCurveMesh();
     Keyframe[] keys = this.m_Curve.keys;
     if (keys.Length > 0)
     {
         Vector3 firstPoint = new Vector3(this.rangeStart, keys.First <Keyframe>().value);
         Vector3 lastPoint  = new Vector3(this.rangeEnd, keys.Last <Keyframe>().value);
         NormalCurveRenderer.DrawCurveWrapped(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode, this.m_CurveMesh, firstPoint, lastPoint, transform, color, wrapColor);
     }
 }
 public static CurveRenderer GetCurveRenderer(AnimationClip clip, EditorCurveBinding curveBinding)
 {
   if (curveBinding.type == typeof (Transform) && curveBinding.propertyName.StartsWith("localEulerAngles."))
   {
     int curveIndexFromName = RotationCurveInterpolation.GetCurveIndexFromName(curveBinding.propertyName);
     string str = CurveUtility.GetCurveGroupID(clip, curveBinding).ToString();
     EulerCurveCombinedRenderer renderer = (EulerCurveCombinedRenderer) CurveRendererCache.m_CombiRenderers[(object) str];
     if (renderer == null)
     {
       renderer = new EulerCurveCombinedRenderer(AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof (Transform), "m_LocalRotation.x")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof (Transform), "m_LocalRotation.y")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof (Transform), "m_LocalRotation.z")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof (Transform), "m_LocalRotation.w")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof (Transform), "localEulerAngles.x")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof (Transform), "localEulerAngles.y")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof (Transform), "localEulerAngles.z")));
       CurveRendererCache.m_CombiRenderers.Add((object) str, (object) renderer);
     }
     return (CurveRenderer) new EulerCurveRenderer(curveIndexFromName, renderer);
   }
   string str1 = CurveUtility.GetCurveID(clip, curveBinding).ToString();
   NormalCurveRenderer normalCurveRenderer = (NormalCurveRenderer) CurveRendererCache.m_NormalRenderers[(object) str1];
   if (normalCurveRenderer == null)
   {
     normalCurveRenderer = new NormalCurveRenderer(AnimationUtility.GetEditorCurve(clip, curveBinding));
     CurveRendererCache.m_NormalRenderers.Add((object) str1, (object) normalCurveRenderer);
   }
   return (CurveRenderer) normalCurveRenderer;
 }
 public static CurveRenderer GetCurveRenderer(AnimationClip clip, EditorCurveBinding curveBinding)
 {
     if ((curveBinding.type == typeof(Transform)) && curveBinding.propertyName.StartsWith("localEulerAngles."))
     {
         int curveIndexFromName = RotationCurveInterpolation.GetCurveIndexFromName(curveBinding.propertyName);
         string str = CurveUtility.GetCurveGroupID(clip, curveBinding).ToString();
         EulerCurveCombinedRenderer renderer = (EulerCurveCombinedRenderer) m_CombiRenderers[str];
         if (renderer == null)
         {
             renderer = new EulerCurveCombinedRenderer(AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "m_LocalRotation.x")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "m_LocalRotation.y")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "m_LocalRotation.z")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "m_LocalRotation.w")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "localEulerAngles.x")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "localEulerAngles.y")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "localEulerAngles.z")));
             m_CombiRenderers.Add(str, renderer);
         }
         return new EulerCurveRenderer(curveIndexFromName, renderer);
     }
     string key = CurveUtility.GetCurveID(clip, curveBinding).ToString();
     NormalCurveRenderer renderer2 = (NormalCurveRenderer) m_NormalRenderers[key];
     if (renderer2 == null)
     {
         renderer2 = new NormalCurveRenderer(AnimationUtility.GetEditorCurve(clip, curveBinding));
         m_NormalRenderers.Add(key, renderer2);
     }
     return renderer2;
 }
 public void DrawCurve(float minTime, float maxTime, Color color, Matrix4x4 transform, int component, Color wrapColor)
 {
     if ((minTime < this.cachedRangeStart) || (maxTime > this.cachedRangeEnd))
     {
         this.CalculateCurves(minTime, maxTime);
         if ((minTime <= this.rangeStart) && (maxTime >= this.rangeEnd))
         {
             this.cachedRangeStart = float.NegativeInfinity;
             this.cachedRangeEnd = float.PositiveInfinity;
         }
         else
         {
             this.cachedRangeStart = minTime;
             this.cachedRangeEnd = maxTime;
         }
     }
     List<Vector3> list = new List<Vector3>();
     foreach (KeyValuePair<float, Vector3> pair in this.points)
     {
         list.Add(new Vector3(pair.Key, pair.Value[component]));
     }
     NormalCurveRenderer.DrawCurveWrapped(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode, color, transform, list.ToArray(), wrapColor);
 }
Exemple #13
0
        private void AddPoints(ref List <Vector3> points, float minTime, float maxTime, float visibleMinTime, float visibleMaxTime)
        {
            if ((double)this.m_Curve[0].time >= (double)minTime)
            {
                points.Add(new Vector3(this.rangeStart, this.m_Curve[0].value));

                points.Add(new Vector3(this.m_Curve[0].time, this.m_Curve[0].value));
            }
            for (int index = 0; index < this.m_Curve.length - 1; ++index)
            {
                Keyframe keyframe1 = this.m_Curve[index];
                Keyframe keyframe2 = this.m_Curve[index + 1];
                if ((double)keyframe2.time >= (double)minTime && (double)keyframe1.time <= (double)maxTime)
                {
                    points.Add(new Vector3(keyframe1.time, keyframe1.value));

                    int   segmentResolution = NormalCurveRenderer.GetSegmentResolution(visibleMinTime, visibleMaxTime, keyframe1.time, keyframe2.time);
                    float num1 = Mathf.Lerp(keyframe1.time, keyframe2.time, 1f / 1000f / (float)segmentResolution);
                    points.Add(new Vector3(num1, this.m_Curve.Evaluate(num1)));
                    for (float num2 = 1f; (double)num2 < (double)segmentResolution; ++num2)
                    {
                        float num3 = Mathf.Lerp(keyframe1.time, keyframe2.time, num2 / (float)segmentResolution);
                        points.Add(new Vector3(num3, this.m_Curve.Evaluate(num3)));
                    }
                    float num4 = Mathf.Lerp(keyframe1.time, keyframe2.time, (float)(1.0 - 1.0 / 1000.0 / (double)segmentResolution));
                    points.Add(new Vector3(num4, this.m_Curve.Evaluate(num4)));
                    float time = keyframe2.time;
                    points.Add(new Vector3(time, keyframe2.value));
                }
            }
            if ((double)this.m_Curve[this.m_Curve.length - 1].time > (double)maxTime)
            {
                return;
            }
            points.Add(new Vector3(this.m_Curve[this.m_Curve.length - 1].time, this.m_Curve[this.m_Curve.length - 1].value));
            points.Add(new Vector3(this.rangeEnd, this.m_Curve[this.m_Curve.length - 1].value));
        }
        public static CurveRenderer GetCurveRenderer(AnimationClip clip, EditorCurveBinding curveBinding)
        {
            if (curveBinding.type == typeof(Transform) && curveBinding.propertyName.StartsWith("localEulerAngles."))
            {
                int    curveIndexFromName = RotationCurveInterpolation.GetCurveIndexFromName(curveBinding.propertyName);
                string key = CurveUtility.GetCurveGroupID(clip, curveBinding).ToString();
                EulerCurveCombinedRenderer eulerCurveCombinedRenderer = (EulerCurveCombinedRenderer)CurveRendererCache.m_CombiRenderers[key];
                if (eulerCurveCombinedRenderer == null)
                {
                    eulerCurveCombinedRenderer = new EulerCurveCombinedRenderer(AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "m_LocalRotation.x")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "m_LocalRotation.y")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "m_LocalRotation.z")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "m_LocalRotation.w")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "localEulerAngles.x")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "localEulerAngles.y")), AnimationUtility.GetEditorCurve(clip, EditorCurveBinding.FloatCurve(curveBinding.path, typeof(Transform), "localEulerAngles.z")));
                    CurveRendererCache.m_CombiRenderers.Add(key, eulerCurveCombinedRenderer);
                }
                return(new EulerCurveRenderer(curveIndexFromName, eulerCurveCombinedRenderer));
            }
            string key2 = CurveUtility.GetCurveID(clip, curveBinding).ToString();
            NormalCurveRenderer normalCurveRenderer = (NormalCurveRenderer)CurveRendererCache.m_NormalRenderers[key2];

            if (normalCurveRenderer == null)
            {
                normalCurveRenderer = new NormalCurveRenderer(AnimationUtility.GetEditorCurve(clip, curveBinding));
                CurveRendererCache.m_NormalRenderers.Add(key2, normalCurveRenderer);
            }
            return(normalCurveRenderer);
        }
 public void DrawCurve(float minTime, float maxTime, Color color, Matrix4x4 transform, Color wrapColor)
 {
     Vector3[] points = this.GetPoints(minTime, maxTime);
     NormalCurveRenderer.DrawCurveWrapped(minTime, maxTime, this.rangeStart, this.rangeEnd, this.preWrapMode, this.postWrapMode, color, transform, points, wrapColor);
 }
        public static void DrawCurveWrapped(float minTime, float maxTime, float rangeStart, float rangeEnd, WrapMode preWrap, WrapMode postWrap, Color color, Matrix4x4 transform, Vector3[] points, Color wrapColor)
        {
            if (points.Length == 0)
            {
                return;
            }
            int num;
            int num2;

            if (rangeEnd - rangeStart != 0f)
            {
                num  = Mathf.FloorToInt((minTime - rangeStart) / (rangeEnd - rangeStart));
                num2 = Mathf.CeilToInt((maxTime - rangeEnd) / (rangeEnd - rangeStart));
            }
            else
            {
                preWrap  = WrapMode.Once;
                postWrap = WrapMode.Once;
                num      = ((minTime >= rangeStart) ? 0 : -1);
                num2     = ((maxTime <= rangeEnd) ? 0 : 1);
            }
            int num3 = points.Length - 1;

            Handles.color = color;
            List <Vector3> list = new List <Vector3>();

            if (num <= 0 && num2 >= 0)
            {
                NormalCurveRenderer.DrawPolyLine(transform, 2f, points);
            }
            else
            {
                Handles.DrawPolyLine(points);
            }
            Handles.color = new Color(wrapColor.r, wrapColor.g, wrapColor.b, wrapColor.a * color.a);
            if (preWrap == WrapMode.Loop)
            {
                list = new List <Vector3>();
                for (int i = num; i < 0; i++)
                {
                    for (int j = 0; j < points.Length; j++)
                    {
                        Vector3 vector = points[j];
                        vector.x += (float)i * (rangeEnd - rangeStart);
                        vector    = transform.MultiplyPoint(vector);
                        list.Add(vector);
                    }
                }
                list.Add(transform.MultiplyPoint(points[0]));
                Handles.DrawPolyLine(list.ToArray());
            }
            else if (preWrap == WrapMode.PingPong)
            {
                list = new List <Vector3>();
                for (int k = num; k < 0; k++)
                {
                    for (int l = 0; l < points.Length; l++)
                    {
                        if ((float)(k / 2) == (float)k / 2f)
                        {
                            Vector3 vector2 = points[l];
                            vector2.x += (float)k * (rangeEnd - rangeStart);
                            vector2    = transform.MultiplyPoint(vector2);
                            list.Add(vector2);
                        }
                        else
                        {
                            Vector3 vector3 = points[num3 - l];
                            vector3.x = -vector3.x + (float)(k + 1) * (rangeEnd - rangeStart) + rangeStart * 2f;
                            vector3   = transform.MultiplyPoint(vector3);
                            list.Add(vector3);
                        }
                    }
                }
                Handles.DrawPolyLine(list.ToArray());
            }
            else if (num < 0)
            {
                Handles.DrawPolyLine(new Vector3[]
                {
                    transform.MultiplyPoint(new Vector3(minTime, points[0].y, 0f)),
                    transform.MultiplyPoint(new Vector3(Mathf.Min(maxTime, points[0].x), points[0].y, 0f))
                });
            }
            if (postWrap == WrapMode.Loop)
            {
                list = new List <Vector3>();
                list.Add(transform.MultiplyPoint(points[num3]));
                for (int m = 1; m <= num2; m++)
                {
                    for (int n = 0; n < points.Length; n++)
                    {
                        Vector3 vector4 = points[n];
                        vector4.x += (float)m * (rangeEnd - rangeStart);
                        vector4    = transform.MultiplyPoint(vector4);
                        list.Add(vector4);
                    }
                }
                Handles.DrawPolyLine(list.ToArray());
            }
            else if (postWrap == WrapMode.PingPong)
            {
                list = new List <Vector3>();
                for (int num4 = 1; num4 <= num2; num4++)
                {
                    for (int num5 = 0; num5 < points.Length; num5++)
                    {
                        if ((float)(num4 / 2) == (float)num4 / 2f)
                        {
                            Vector3 vector5 = points[num5];
                            vector5.x += (float)num4 * (rangeEnd - rangeStart);
                            vector5    = transform.MultiplyPoint(vector5);
                            list.Add(vector5);
                        }
                        else
                        {
                            Vector3 vector6 = points[num3 - num5];
                            vector6.x = -vector6.x + (float)(num4 + 1) * (rangeEnd - rangeStart) + rangeStart * 2f;
                            vector6   = transform.MultiplyPoint(vector6);
                            list.Add(vector6);
                        }
                    }
                }
                Handles.DrawPolyLine(list.ToArray());
            }
            else if (num2 > 0)
            {
                Handles.DrawPolyLine(new Vector3[]
                {
                    transform.MultiplyPoint(new Vector3(Mathf.Max(minTime, points[num3].x), points[num3].y, 0f)),
                    transform.MultiplyPoint(new Vector3(maxTime, points[num3].y, 0f))
                });
            }
        }
Exemple #17
0
        public static void DrawCurveWrapped(float minTime, float maxTime, float rangeStart, float rangeEnd, WrapMode preWrap, WrapMode postWrap, Color color, Matrix4x4 transform, Vector3[] points, Color wrapColor)
        {
            if (points.Length == 0)
            {
                return;
            }
            int num1;
            int num2;

            if ((double)rangeEnd - (double)rangeStart != 0.0)
            {
                num1 = Mathf.FloorToInt((float)(((double)minTime - (double)rangeStart) / ((double)rangeEnd - (double)rangeStart)));
                num2 = Mathf.CeilToInt((float)(((double)maxTime - (double)rangeEnd) / ((double)rangeEnd - (double)rangeStart)));
            }
            else
            {
                preWrap  = WrapMode.Once;
                postWrap = WrapMode.Once;
                num1     = (double)minTime >= (double)rangeStart ? 0 : -1;
                num2     = (double)maxTime <= (double)rangeEnd ? 0 : 1;
            }
            int index1 = points.Length - 1;

            Handles.color = color;
            List <Vector3> vector3List1 = new List <Vector3>();

            if (num1 <= 0 && num2 >= 0)
            {
                NormalCurveRenderer.DrawPolyLine(transform, 2f, points);
            }
            else
            {
                Handles.DrawPolyLine(points);
            }
            Handles.color = new Color(wrapColor.r, wrapColor.g, wrapColor.b, wrapColor.a * color.a);
            if (preWrap == WrapMode.Loop)
            {
                List <Vector3> vector3List2 = new List <Vector3>();
                for (int index2 = num1; index2 < 0; ++index2)
                {
                    for (int index3 = 0; index3 < points.Length; ++index3)
                    {
                        Vector3 point = points[index3];
                        point.x += (float)index2 * (rangeEnd - rangeStart);
                        Vector3 vector3 = transform.MultiplyPoint(point);
                        vector3List2.Add(vector3);
                    }
                }
                vector3List2.Add(transform.MultiplyPoint(points[0]));
                Handles.DrawPolyLine(vector3List2.ToArray());
            }
            else if (preWrap == WrapMode.PingPong)
            {
                List <Vector3> vector3List2 = new List <Vector3>();
                for (int index2 = num1; index2 < 0; ++index2)
                {
                    for (int index3 = 0; index3 < points.Length; ++index3)
                    {
                        if ((double)(index2 / 2) == (double)index2 / 2.0)
                        {
                            Vector3 point = points[index3];
                            point.x += (float)index2 * (rangeEnd - rangeStart);
                            Vector3 vector3 = transform.MultiplyPoint(point);
                            vector3List2.Add(vector3);
                        }
                        else
                        {
                            Vector3 point = points[index1 - index3];
                            point.x = (float)(-(double)point.x + (double)(index2 + 1) * ((double)rangeEnd - (double)rangeStart) + (double)rangeStart * 2.0);
                            Vector3 vector3 = transform.MultiplyPoint(point);
                            vector3List2.Add(vector3);
                        }
                    }
                }
                Handles.DrawPolyLine(vector3List2.ToArray());
            }
            else if (num1 < 0)
            {
                Handles.DrawPolyLine(transform.MultiplyPoint(new Vector3(minTime, points[0].y, 0.0f)), transform.MultiplyPoint(new Vector3(Mathf.Min(maxTime, points[0].x), points[0].y, 0.0f)));
            }
            if (postWrap == WrapMode.Loop)
            {
                List <Vector3> vector3List2 = new List <Vector3>();
                vector3List2.Add(transform.MultiplyPoint(points[index1]));
                for (int index2 = 1; index2 <= num2; ++index2)
                {
                    for (int index3 = 0; index3 < points.Length; ++index3)
                    {
                        Vector3 point = points[index3];
                        point.x += (float)index2 * (rangeEnd - rangeStart);
                        Vector3 vector3 = transform.MultiplyPoint(point);
                        vector3List2.Add(vector3);
                    }
                }
                Handles.DrawPolyLine(vector3List2.ToArray());
            }
            else if (postWrap == WrapMode.PingPong)
            {
                List <Vector3> vector3List2 = new List <Vector3>();
                for (int index2 = 1; index2 <= num2; ++index2)
                {
                    for (int index3 = 0; index3 < points.Length; ++index3)
                    {
                        if ((double)(index2 / 2) == (double)index2 / 2.0)
                        {
                            Vector3 point = points[index3];
                            point.x += (float)index2 * (rangeEnd - rangeStart);
                            Vector3 vector3 = transform.MultiplyPoint(point);
                            vector3List2.Add(vector3);
                        }
                        else
                        {
                            Vector3 point = points[index1 - index3];
                            point.x = (float)(-(double)point.x + (double)(index2 + 1) * ((double)rangeEnd - (double)rangeStart) + (double)rangeStart * 2.0);
                            Vector3 vector3 = transform.MultiplyPoint(point);
                            vector3List2.Add(vector3);
                        }
                    }
                }
                Handles.DrawPolyLine(vector3List2.ToArray());
            }
            else
            {
                if (num2 <= 0)
                {
                    return;
                }
                Handles.DrawPolyLine(transform.MultiplyPoint(new Vector3(Mathf.Max(minTime, points[index1].x), points[index1].y, 0.0f)), transform.MultiplyPoint(new Vector3(maxTime, points[index1].y, 0.0f)));
            }
        }