Skip to main content

MeasureDistance

A class in Root.Township, the global namespace.

Editor helper that shows the world and local distance to a target transform in the inspector and draws a line to it.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private float distanceWorld distance to the target.
private float localDistanceDistance between the two local positions.
private float localPositionMagnitudeLength of this object's local position.
private Transform targetTransform measured to.

Methods​

2 private and internal methods
MemberWhat it is
private void OnDrawGizmosSelected()Updates the distances and draws a line to the target.
private void OnValidate()Updates the shown distances.