Skip to main content

RadiusHeatArea

A class in Root.Township, Alta.Heat.

Shapes a HeatArea as a sphere: full temperature inside innerRadius, fading to none at outerRadius.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private float innerRadiusDistance within which the multiplier is 1.
private Vector3 originLocal offset of the sphere centre.
private float outerRadiusDistance at which the multiplier reaches 0.

Properties​

1 private and internal property
MemberWhat it is
private Vector3 Origin { get; }Sphere centre in world space.

Methods​

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