Skip to main content

HeatManager

A class in Root.Township, Alta.Heat.

Server: burns a HealthObject with fire damage while any heat point in its HeatPointCollection is hot. Used on creatures and other things that take fire damage.

Constructors​

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

Fields​

8 private and internal fields
MemberWhat it is
private float burnDamageThresholdTemperature above which a heat point counts as hot and deals the small burningTickDamage when it rises.
private float burningTickDamageDamage per update for each hot (but not ignited) heat point whose temperature went up.
private HeatPointCollection collectionThe heat points that are checked for burning.
private static DamageData damageDataShared damage info with source Fire, used for every burn hit.
private AnimationCurve damagePerTemperatureCurve from temperature to damage per update for heat points past the ignition threshold.
private HealthObject damageTargetThe HealthObject that takes the fire damage.
private List<HeatManager.HeatPointDamageLevel> heatPointLevelsPer heat point burn level trackers (none, hot or ignited), built on the server.
private float ignitionThresholdTemperature above which a heat point counts as ignited and deals curve damage.

Methods​

5 private and internal methods
MemberWhat it is
private void BurnUpdate(StatManager manager)Runs on each stat update while something is hot. Deals fire damage from the temperature curve for ignited points, or a small tick for warming points.
private void Initialize(NetworkEntity entity)Server: once the entity is initialized, tracks each heat point's burn level and hooks the stat manager's reset.
private void OnReset(StatManager manager)When the target's stats reset, instantly extinguishes every heat point's heat source and resets the collection.
private void Start()Waits for the target entity to finish initializing, then calls Initialize.
private void UpdateLevel(int level)Called when a heat point's burn level changes. Subscribes BurnUpdate when the first point gets hot and removes it when none are.