Skip to main content

AdjustHeight

A class in Root.Township, the global namespace.

Client: moves target transforms to a fraction of the local player's head height.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private bool isSettingLocalPositionWhether to set the local height instead of the world height.
private float minimumHeightLowest height allowed. Defaults to 1.
private float percentageOfPlayersHeightFraction of the head height, 0 to 1. Defaults to 0.5.
private Transform[] targetsTransforms to move.

Methods​

MemberWhat it is
void UpdateHeight()Starts the height adjustment.
void UpdatePercentage(float newPercentage)Changes the fraction of the player's height used.
1 private and internal method
MemberWhat it is
private IEnumerator DelayAdjust() (iterator)At the end of the frame, sets each target's height to the player's head offset times the fraction, at least minimumHeight.