Class SplineExtrude
A component for creating a tube mesh from a Spline at runtime.
Inherited Members
UnityEngine.Component.GetComponentInParent<T>(System.Boolean)
UnityEngine.Object.FindObjectsOfType<T>(System.Boolean)
UnityEngine.Object.FindObjectOfType<T>(System.Boolean)
Namespace: UnityEngine.Splines
Syntax
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
[AddComponentMenu("Splines/Spline Extrude")]
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 |
---|---|
Boolean |
Container
The SplineContainer of the Spline to extrude.
Declaration
public SplineContainer Container { get; set; }
Property Value
Type | Description |
---|---|
SplineContainer |
Radius
The radius of the extruded mesh.
Declaration
public float Radius { get; set; }
Property Value
Type | Description |
---|---|
Single |
Range
The section of the Spline to extrude.
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 |
---|---|
Int32 |
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 |
---|---|
Boolean |
SegmentsPerUnit
How many edge loops comprise the one unit length of the mesh.
Declaration
public float SegmentsPerUnit { get; set; }
Property Value
Type | Description |
---|---|
Single |
Sides
How many sides make up the radius of the mesh.
Declaration
public int Sides { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
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()