Class SplineExtrude
A component for creating a tube mesh from a Spline at runtime.
Inherited Members
Namespace: UnityEngine.Splines
Assembly: Unity.Splines.dll
Syntax
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
[AddComponentMenu("Splines/Spline Extrude")]
[ExecuteAlways]
public class SplineExtrude : MonoBehaviour
Properties
Capped
Whether the start and end of the mesh is filled. This setting is ignored when spline is closed.
Declaration
public bool Capped { get; set; }
Property Value
Type | Description |
---|---|
bool |
Container
The SplineContainer of the Spline to extrude.
Declaration
public SplineContainer Container { get; set; }
Property Value
Type | Description |
---|---|
SplineContainer |
FlipNormals
Set true to reverse the winding order of vertices so that the face normals are inverted. This is useful primarily for SplineShape templates where the input path may not produce a counter-clockwise vertex ring. Counter-clockwise winding equates to triangles facing outwards.
Declaration
public bool FlipNormals { get; set; }
Property Value
Type | Description |
---|---|
bool |
Radius
The radius of the extruded mesh.
Declaration
public float Radius { get; set; }
Property Value
Type | Description |
---|---|
float |
Range
The section of the Spline to extrude. The X value is the start interpolation, the Y value is the end interpolation. X and Y are normalized values between 0 and 1.
Declaration
public Vector2 Range { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
RebuildFrequency
The maximum number of times per-second that the mesh will be rebuilt.
Declaration
public int RebuildFrequency { get; set; }
Property Value
Type | Description |
---|---|
int |
RebuildOnSplineChange
Enable to regenerate the extruded mesh when the target Spline is modified. Disable this option if the Spline will not be modified at runtime.
Declaration
public bool RebuildOnSplineChange { get; set; }
Property Value
Type | Description |
---|---|
bool |
SegmentsPerUnit
How many edge loops comprise the one unit length of the mesh.
Declaration
public float SegmentsPerUnit { get; set; }
Property Value
Type | Description |
---|---|
float |
Sides
How many sides make up the radius of the mesh.
Declaration
public int Sides { get; set; }
Property Value
Type | Description |
---|---|
int |
Spline
The main Spline to extrude.
Declaration
public Spline Spline { get; }
Property Value
Type | Description |
---|---|
Spline |
Splines
The Splines to extrude.
Declaration
public IReadOnlyList<Spline> Splines { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<Spline> |
Methods
Rebuild()
Triggers the rebuild of a Spline's extrusion mesh and collider.
Declaration
public void Rebuild()