Class SplinePath
The SplinePath type is an implementation of ISpline that is composed of multiple sections of other splines (see SplineSlice<T>). This is useful when you want to evaluate a path that follows multiple splines, typically in the case where splines share linked knots.
This class is a data structure that defines the range of curves to associate together. This class is not meant to be used intensively for runtime evaluation because it is not performant. Data is not meant to be stored in that struct and that struct is not reactive to spline changes. The GameObject that contains this slice can be scaled and the knots of the targeted spline that can moved around the curve length cannot be stored here so evaluating positions, tangents and up vectors is expensive.
If performance is a critical requirement, create a new Spline or NativeSpline from your SplinePath<T>. Note that you might pass a SplinePath<T> to constructors for both Spline and NativeSpline.
Implements
Inherited Members
Namespace: UnityEngine.Splines
Assembly: Unity.Splines.dll
Syntax
public class SplinePath : SplinePath<SplineSlice<Spline>>, ISpline, IReadOnlyList<BezierKnot>, IReadOnlyCollection<BezierKnot>, IEnumerable<BezierKnot>, IEnumerable, IHasEmptyCurves
Constructors
SplinePath(IEnumerable<SplineSlice<Spline>>)
Creates a new SplinePath from a collection of SplineSlice<T>.
Declaration
public SplinePath(IEnumerable<SplineSlice<Spline>> slices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<SplineSlice<Spline>> | slices | The splines to create this path with. |