Assets/SplineTool/Scripts/CorgiSpline/Spline.cs
/// <summary>
/// Opens or closes the spline, handling any internal changes necessary based on the spline's Mode.
/// </summary>
/// <param name="closed"></param>
Opens or closes the spline, handling any internal changes necessary based on the spline's Mode.
Opens or closes the spline handling any internal changes necessary based on the spline ' s Mode .
public void SetSplineClosed(bool closed)
        {
            var needsUpdate = ClosedSpline != closed;
            ClosedSpline = closed;
            if (needsUpdate)
            {
                if(closed)
                {
                    switch (GetSplineMode())
                    {
                        case SplineMode.Linear:
                            ResizePointArray(Points.Length + 1);
                            break;
                        case SplineMode.Bezier:
                            ResizePointArray(Points.Length + 3);
                            break;
                        case SplineMode.BSpline:
                            ResizePointArray(Points.Length + 1);
                            break;
                        default:
                            break;
                    }
                    EnsureSplineStaysClosed();
                }
                else
                {
                    switch (GetSplineMode())
                    {
                        case SplineMode.Linear:
                            ResizePointArray(Points.Length - 1); 
                            break;
                        case SplineMode.Bezier:
                            ResizePointArray(Points.Length - 3); 
                            break;
                        case SplineMode.BSpline:
                            ResizePointArray(Points.Length - 1); 
                            break;
                        default:
                            break;
                    }
                }
            }
        }
public void SetSplineClosed ( bool closed ) { var needsUpdate = ClosedSpline != closed ; ClosedSpline = closed ; if ( needsUpdate ) { if ( closed ) { switch ( GetSplineMode ( ) ) { case SplineMode . Linear : ResizePointArray ( Points . Length + 1 ) ; break ; case SplineMode . Bezier : ResizePointArray ( Points . Length + 3 ) ; break ; case SplineMode . BSpline : ResizePointArray ( Points . Length + 1 ) ; break ; default : break ; } EnsureSplineStaysClosed ( ) ; } else { switch ( GetSplineMode ( ) ) { case SplineMode . Linear : ResizePointArray ( Points . Length - 1 ) ; break ; case SplineMode . Bezier : ResizePointArray ( Points . Length - 3 ) ; break ; case SplineMode . BSpline : ResizePointArray ( Points . Length - 1 ) ; break ; default : break ; } } } }
Opens or closes the spline, handling any internal changes necessary based on the spline's Mode.
Opens or closes the spline handling any internal changes necessary based on the spline ' s Mode .
// closing  // not implemented  // opening  // remove extra point  // remove extra points // remove extra point  // not implemented 
closed
bool
None