public void UpdateSpline()
 {
     if (spline == null)
     {
         return;
     }
     if (!isClosed && spline.isClosed)
     {
         spline.Break();
     }
     else if (spline.isClosed && points.Length < 4)
     {
         spline.Break();
         isClosed = false;
     }
     spline.SetPoints(points);
     if (isClosed && !spline.isClosed)
     {
         spline.Close();
     }
     spline.type       = splineType;
     spline.sampleRate = sampleRate;
     spline.is2D       = is2D;
     spline.EditorUpdateConnectedNodes();
 }
 public virtual void Close()
 {
     if (lastClosed)
     {
         computer.Close();
     }
     else
     {
         computer.Break();
     }
     computer.SetPoints(lastPoints, SplineComputer.Space.Local);
     computer.type = lastType;
 }
Exemplo n.º 3
0
 public void BreakSpline()
 {
     RecordUndo("Break path");
     if (splines.Length == 1 && pathEditor.selectedPoints.Count == 1)
     {
         spline.Break(pathEditor.selectedPoints[0]);
     }
     else
     {
         for (int i = 0; i < splines.Length; i++)
         {
             splines[i].Break();
         }
     }
 }
Exemplo n.º 4
0
 public void UpdateSplineComputer(SplineComputer comp)
 {
     Generate();
     ApplyOffset();
     comp.type = GetSplineType();
     comp.SetPoints(points, SplineComputer.Space.Local);
     if (closed)
     {
         comp.Close();
     }
     else if (comp.isClosed)
     {
         comp.Break();
     }
 }