Exemple #1
0
        public static void RefreshNonLinearDrawWps(Path p)
        {
            int num = p.wps.Length * 10;

            if ((p.nonLinearDrawWps == null) || (p.nonLinearDrawWps.Length != (num + 1)))
            {
                p.nonLinearDrawWps = new Vector3[num + 1];
            }
            for (int i = 0; i <= num; i++)
            {
                float perc = ((float)i) / ((float)num);
                p.nonLinearDrawWps[i] = p.GetPoint(perc, false);
            }
        }
Exemple #2
0
        internal static void RefreshNonLinearDrawWps(Path p)
        {
            int num = p.wps.Length * 10;

            if (p.nonLinearDrawWps == null || p.nonLinearDrawWps.Length != num + 1)
            {
                p.nonLinearDrawWps = new Vector3[num + 1];
            }
            for (int i = 0; i <= num; i++)
            {
                float   perc  = (float)i / (float)num;
                Vector3 point = p.GetPoint(perc, false);
                p.nonLinearDrawWps[i] = point;
            }
        }
Exemple #3
0
        // Refreshes the waypoints used to draw non-linear gizmos and the PathInspector scene view.
        // Called by Draw method or by DOTweenPathInspector
        internal static void RefreshNonLinearDrawWps(Path p)
        {
            int wpsCount = p.wps.Length;

            int gizmosSubdivisions = wpsCount * 10;

            if (p.nonLinearDrawWps == null || p.nonLinearDrawWps.Length != gizmosSubdivisions + 1)
            {
                p.nonLinearDrawWps = new Vector3[gizmosSubdivisions + 1];
            }
            for (int i = 0; i <= gizmosSubdivisions; ++i)
            {
                float   perc = i / (float)gizmosSubdivisions;
                Vector3 wp   = p.GetPoint(perc);
                p.nonLinearDrawWps[i] = wp;
            }
        }
Exemple #4
0
        public static Vector3[] GetDrawPoints(Path p, int drawSubdivisionsXSegment)
        {
            int length = p.wps.Length;

            if (p.type == PathType.Linear)
            {
                return(p.wps);
            }
            int num2 = length * drawSubdivisionsXSegment;

            Vector3[] vectorArray = new Vector3[num2 + 1];
            for (int i = 0; i <= num2; i++)
            {
                float perc = ((float)i) / ((float)num2);
                vectorArray[i] = p.GetPoint(perc, false);
            }
            return(vectorArray);
        }
Exemple #5
0
        internal static Vector3[] GetDrawPoints(Path p, int drawSubdivisionsXSegment)
        {
            int num = p.wps.Length;

            if (p.type == PathType.Linear)
            {
                return(p.wps);
            }
            int num2 = num * drawSubdivisionsXSegment;

            Vector3[] array = new Vector3[num2 + 1];
            for (int i = 0; i <= num2; i++)
            {
                float   perc   = (float)i / (float)num2;
                Vector3 vector = array[i] = p.GetPoint(perc, false);
            }
            return(array);
        }
Exemple #6
0
        // USED EXTERNALLY, to output a series of points that can be used to draw the path outside of DOTween
        // (called by TweenExtensions.PathGetDrawPoints)
        internal static Vector3[] GetDrawPoints(Path p, int drawSubdivisionsXSegment)
        {
            int wpsCount = p.wps.Length;

            if (p.type == PathType.Linear)
            {
                return(p.wps);
            }

            int gizmosSubdivisions = wpsCount * drawSubdivisionsXSegment;

            Vector3[] drawPoints = new Vector3[gizmosSubdivisions + 1];
            for (int i = 0; i <= gizmosSubdivisions; ++i)
            {
                float   perc = i / (float)gizmosSubdivisions;
                Vector3 wp   = p.GetPoint(perc);
                drawPoints[i] = wp;
            }
            return(drawPoints);
        }
Exemple #7
0
        // Refreshes the waypoints used to draw non-linear gizmos and the PathInspector scene view.
        // Called by Draw method or by DOTweenPathInspector
        internal static void RefreshNonLinearDrawWps(Path p)
        {
            int wpsCount = p.wps.Length;

            int gizmosSubdivisions = wpsCount * 10;
            if (p.nonLinearDrawWps == null || p.nonLinearDrawWps.Length != gizmosSubdivisions + 1)
                p.nonLinearDrawWps = new Vector3[gizmosSubdivisions + 1];
            for (int i = 0; i <= gizmosSubdivisions; ++i) {
                float perc = i / (float)gizmosSubdivisions;
                Vector3 wp = p.GetPoint(perc);
                p.nonLinearDrawWps[i] = wp;
            }
        }
Exemple #8
0
        // USED EXTERNALLY, to output a series of points that can be used to draw the path outside of DOTween
        // (called by TweenExtensions.PathGetDrawPoints)
        internal static Vector3[] GetDrawPoints(Path p, int drawSubdivisionsXSegment)
        {
            int wpsCount = p.wps.Length;
            if (p.type == PathType.Linear) return p.wps;

            int gizmosSubdivisions = wpsCount * drawSubdivisionsXSegment;
            Vector3[] drawPoints = new Vector3[gizmosSubdivisions + 1];
            for (int i = 0; i <= gizmosSubdivisions; ++i) {
                float perc = i / (float)gizmosSubdivisions;
                Vector3 wp = p.GetPoint(perc);
                drawPoints[i] = wp;
            }
            return drawPoints;
        }