An abstract class in Root.Township, Alta.Bezier.
Base for something built along a parent BezierSpline (a mesh, fence and so on). It rebuilds when the spline changes and can be baked to remove itself.
Constructors
| Member | What it is |
|---|
protected SplineDisplay() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|
protected bool isGenerated | True once it has been built. |
2 private and internal fields
| Member | What it is |
|---|
private bool isUpdating | Whether the display regenerates when its spline changes. |
private BezierSpline spline | Backing field for Spline, filled from the parent BezierSpline on first use. |
Properties
| Member | What it is |
|---|
bool IsBaked { get; set; } | True once baked. |
BezierSpline Spline { get; } | The spline in the parents, found on first use. |
protected virtual bool IsHeadlessOnly { get; } | Despite the name, true means it is skipped on a headless server. True by default. |
protected bool IsPrefab { get; } | Always false in this build. |
Methods
| Member | What it is |
|---|
void Bake() | Builds once, then destroys this component so only the result stays. |
void Generate() | Builds the display. |
virtual void OnValidate() | Editor hook. Empty here. |
protected abstract void GenerateInternal() | Subclass: does the building. |
protected virtual void Start() | Builds once and starts listening to spline changes, unless skipped on headless. |
protected virtual void Update() | Empty here. |
1 private and internal method
| Member | What it is |
|---|
private void SplineChanged(BezierSpline spline) | Handler for the spline's Changed event; regenerates if isUpdating is on, or unsubscribes if the spline no longer belongs to it. |