Skip to main content

MouldRack

A class in Root.Township, Alta.Blacksmithing.

Visual rack that slides a set of mould frames along curves. Setting Slide moves the frames, snapping toward one frame per step.

Constructors​

MemberWhat it is
MouldRack()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

8 private and internal fields
MemberWhat it is
private Transform[] framesThe mould frame transforms that move.
private AnimationCurve progressCurveCurve from slide progress to the time used for the position and rotation curves.
private float seperationSpacing between frames along the progress curve.
private float slideBacking field for Slide.
private float snapWeightHow strongly the slide snaps to frame steps. 1 means no snapping.
private AnimationCurve xRotationCurve for each frame's X rotation, in degrees.
private AnimationCurve yPositionCurve for each frame's local Y position.
private AnimationCurve zPositionCurve for each frame's local Z position.

Properties​

MemberWhat it is
float Slide { get; set; }Rack position from 0 to 1. Setting it moves the frames.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Places the frames for the starting slide.
private void OnValidate()Places the frames when edited in the inspector.
private void UpdatePositions()Snaps the slide toward the nearest frame step, then sets each frame's position and rotation from the curves.