Пример #1
0
        /// <summary>
        /// helper for drawing gizmos in the editor
        /// </summary>
        public static void DrawGizmos(Vector3[] nodes, float resolution = 50, bool isInEditMode = false)
        {
            // horribly inefficient but it only runs in the editor
            var spline = new Spline(new List <Vector3>(nodes));

            spline.DrawGizmos(resolution, isInEditMode);
        }
Пример #2
0
        public void OnDrawGizmosSelected()
        {
            // the editor will draw paths when force straight line is on
            if (!ForceStraightLinePath)
            {
                var spline = new Spline(Nodes, UseBezier, ForceStraightLinePath);
                if (ClosePath)
                {
                    spline.ClosePath();
                }

                Gizmos.color = PathColor;
                spline.DrawGizmos(PathResolution, IsInEditMode);
            }
        }