Skip to main content

CylinderHeatArea

A class in Root.Township, Alta.Heat.

Shapes a HeatArea as a cylinder: heat points get full temperature inside innerRadius of the axis, fading to none at outerRadius.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private Vector3 cylinderAxisLocal axis direction of the cylinder.
private float innerRadiusDistance from the axis within which the multiplier is 1.
private Vector3 originLocal offset of the cylinder centre.
private float outerRadiusDistance from the axis at which the multiplier reaches 0.

Properties​

2 private and internal properties
MemberWhat it is
private Vector3 Axis { get; }The cylinder axis in world space.
private Vector3 Origin { get; }The cylinder centre in world space.

Methods​

MemberWhat it is
protected override float GetTemperatureMultiplier(HeatPoint point)0 to 1 multiplier from the point's distance to the axis, between outer and inner radius.
2 private and internal methods
MemberWhat it is
private void OnDrawGizmosSelected()Draws the inner and outer cylinders in the editor.
private void OnValidate()Editor: when outerRadius is negative, copies radius and centre from a SphereCollider on the object.