示例#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);
            }
        }
示例#2
0
文件: Path.cs 项目: YYliss/DoTween-1
        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;
            }
        }
示例#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;
            }
        }
示例#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);
        }
示例#5
0
文件: Path.cs 项目: YYliss/DoTween-1
        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);
        }
示例#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);
        }
示例#7
0
文件: Path.cs 项目: Grogal/dotween
        // 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;
            }
        }
示例#8
0
文件: Path.cs 项目: SylarLi/Puzzle1
        // 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;
        }