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.
- Listed in Creatures and AI
- Inherits or implements
StatChangeHook - Nested types
TopicProgress - Documented in Actions and decisions
Constructors
| Member | What it is |
|---|---|
ProgressStatChangeHook() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|---|
private AnimationCurve addedValueOverTime | Curve of the total amount added to the stat over time. |
private bool isNormalizedTime | If true, curve time runs from 0 to 1 over the action's editor duration instead of in seconds. |
private Dictionary<IAgent, ProgressStatChangeHook.TopicProgress> progresses | Running progress per agent; each one updates the stat every frame. |
private bool removeOnEnd | If true, the amount added is taken off the stat again when the action ends. |
Methods
| Member | What 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: