Example #1
0
        private void closeRoute()
        {
            // we will use the GoSpline class to handle the dirtywork of closing the path
            var path = new Spline(_target.Nodes, _target.UseBezier, _target.ForceStraightLinePath);

            path.ClosePath();

            _target.Nodes = path.Nodes;

            GUI.changed = true;
        }
Example #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);
            }
        }