A class in Root.Township, Alta.Character.
Moves a player character's tool belt and pouch docks in or out from a centre point to suit their body type. PlayerCharacter holds one and calls Setup with the body type's ratios.
Constructors
Fields
7 private and internal fields
| Member | What it is |
|---|
private AccessibleDocks accessibleDocks | Private: the character's AccessibleDocks, told when positioning is done. |
private Transform center | Private: the point the dock offsets are measured from. |
private bool hasSetup | Private: whether the original offsets have been recorded. |
private Vector3[] pouchDistances | Private: original pouch dock offsets from the centre. |
private Transform[] pouchDocks | Private: the pouch belt dock transforms. |
private Vector3[] toolDistances | Private: original tool dock offsets from the centre. |
private Transform[] toolDocks | Private: the tool belt dock transforms. |
Methods
| Member | What it is |
|---|
static DockPositionController Duplicate(DockPositionController original, Transform parent) | Makes a copy with new instances of every dock and the centre, parented under the given transform at the same positions. |
void Setup(float toolDistanceRatio, float pouchDistanceRatio) | Scales tool and pouch dock offsets by the given ratios, recording the original offsets the first time, then finishes AccessibleDocks setup. |
3 private and internal methods
| Member | What it is |
|---|
private void PositionDocks(float toolDistanceRatio, Vector3[] distances, Transform[] docks, Vector3 centerPosition) | Private: places each dock at its original offset from the centre, scaled by the ratio. |
private void Setup(Vector3 centerPosition) | Scales tool and pouch dock offsets by the given ratios, recording the original offsets the first time, then finishes AccessibleDocks setup. |
private void SetupDocks(Transform[] docks, ref Vector3[] distances, Vector3 centerPosition) | Private: records each dock's offset from the centre. |
Used in
Members of other types that take, return or hold a DockPositionController: