Class SplineShape
Create a shape using a Spline as the template path. The
referenced Spline is sampled at Side
Implements
Inherited Members
Namespace: UnityEngine .Splines.ExtrusionShapes
Assembly: Unity.Splines.dll
Syntax
[Serializable]
public class SplineShape : IExtrudeShape
Fields
m_Axis
Defines the axes used to project the input spline template to 2D coordinates.
Declaration
[SerializeField]
[Tooltip("The axis of the template spline to be used when winding the vertices along the extruded mesh.")]
public SplineShape.Axis m_Axis
Field Value
Type | Description |
---|---|
Spline |
Properties
SideCount
How many vertices make up a single ring around the mesh.
Declaration
public int SideCount { get; set; }
Property Value
Type | Description |
---|---|
int | How many vertices make up a revolution for each segment of the extruded mesh. |
Spline
Returns the Spline referenced by the
Spline
Declaration
public Spline Spline { get; }
Property Value
Type | Description |
---|---|
Spline |
SplineContainer
The Spline
Declaration
public SplineContainer SplineContainer { get; set; }
Property Value
Type | Description |
---|---|
Spline |
SplineIndex
The index of the Spline in the Spline
Declaration
public int SplineIndex { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
GetPosition(float, int)
This method is responsible for returning a 2D position of the template shape for each vertex of a single
ring around the extruded mesh.
Note that both interpolation t
and index
are provided as a convenience.
Declaration
public float2 GetPosition(float t, int index)
Parameters
Type | Name | Description |
---|---|---|
float | t | The normalized interpolation [0...1] for a vertex around an extruded ring. |
int | index | The index of the vertex in the extruded ring. |
Returns
Type | Description |
---|---|
float2 | A 2D position interpolated along a template shape to be extruded. This value will be converted to a 3D point and rotated to align with the spline at the current segment index. |