Skip to main content

ProgressStatChangeHook

A class in Root.Township, Alta.Intelligence.

A stat change hook that adds to a stat's base value along a curve while an AI action runs, one progress per agent. Optionally takes the added amount back when the action ends.

Constructors​

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

Fields​

4 private and internal fields
MemberWhat it is
private AnimationCurve addedValueOverTimeCurve of the total amount added to the stat over time.
private bool isNormalizedTimeIf true, curve time runs from 0 to 1 over the action's editor duration instead of in seconds.
private Dictionary<IAgent, ProgressStatChangeHook.TopicProgress> progressesRunning progress per agent; each one updates the stat every frame.
private bool removeOnEndIf true, the amount added is taken off the stat again when the action ends.

Methods​

MemberWhat it is
float ValueOverTime(float time)Evaluates the added-value curve at a time (seconds, or normalized to the action's duration).
protected override void AffectOnEnd(IActiveAction finished)Stops the agent's running progress, removing what it added if removeOnEnd is set.
protected override void AffectOnStart(IActiveAction active)Starts a new progress for the action's agent, replacing any progress already running for it.

Used in​

Members of other types that take, return or hold a ProgressStatChangeHook: