Skip to main content

RaycastPreview

A class in Root.Township, the global namespace.

Editor helper that draws a gizmo raycast forward from the object: green to the hit with a blue normal, red if nothing is hit.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private RaycastHit hitLast raycast hit.
private LayerMask maskLayers the ray hits.
private float maximumDistanceRay length.

Methods​

1 private and internal method
MemberWhat it is
private void OnDrawGizmos()Casts the ray and draws the result.