コード例 #1
0
        public void drawGizmos(float resolution, bool isInEditMode)
        {
            if (_solver.nodes.Count == 0)
            {
                return;
            }

            if (isInEditMode)
            {
                _solver.drawGizmos();
            }

            var previousPoint = _solver.getPoint(0);

            resolution *= _solver.nodes.Count;
            for (var i = 1; i <= resolution; i++)
            {
                var t            = (float)i / resolution;
                var currentPoint = _solver.getPoint(t);
                Gizmos.DrawLine(currentPoint, previousPoint);
                previousPoint = currentPoint;
            }
        }