Пример #1
0
        // Token: 0x06000719 RID: 1817 RVA: 0x0002EBB8 File Offset: 0x0002CFB8
        private void DrawCurved()
        {
            int num = Mathf.RoundToInt(1f / this.spacing) + 1;

            this.line.SetVertexCount(num);
            float num2 = 0f;

            for (int i = 0; i < num; i++)
            {
                this.line.SetPosition(i, WaypointManager.GetPoint(this.points, num2));
                num2 += this.spacing;
            }
        }
Пример #2
0
        //draw curved path positions
        void DrawCurved()
        {
            //set initial LineRenderer size based on spacing
            int size = Mathf.RoundToInt(1f / spacing) + 1;

            line.SetVertexCount(size);
            float t = 0f;
            int   i = 0;

            //loop over positions and set calculated path point
            while (i < size)
            {
                line.SetPosition(i, WaypointManager.GetPoint(points, t));
                t += spacing;
                i++;
            }
        }
        // Token: 0x0600072F RID: 1839 RVA: 0x0002F56C File Offset: 0x0002D96C
        public static void DrawCurved(Vector3[] waypoints)
        {
            Vector3[] array = new Vector3[waypoints.Length + 2];
            waypoints.CopyTo(array, 1);
            array[0] = waypoints[1];
            array[array.Length - 1] = array[array.Length - 2];
            int num = array.Length * 10;

            Vector3[] array2 = new Vector3[num + 1];
            for (int i = 0; i <= num; i++)
            {
                float   t      = (float)i / (float)num;
                Vector3 vector = WaypointManager.GetPoint(array, t);
                array2[i] = vector;
            }
            Vector3 to = array2[0];

            for (int j = 1; j < array2.Length; j++)
            {
                Vector3 vector = array2[j];
                Gizmos.DrawLine(vector, to);
                to = vector;
            }
        }