StatAffectingArea
A class in Root.Township, Alta.StatSystem.
Server trigger area that changes a stat by a fixed amount per second on every rigidbody inside it that has a matching StatAffectAccessor. Removes itself on clients.
- Listed in Stats, effects, heat and liquid
- Inherits or implements
MonoBehaviour - Documented in Stats
Constructors
| Member | What it is |
|---|---|
StatAffectingArea() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
9 private and internal fields
| Member | What it is |
|---|---|
private Dictionary<Rigidbody, Stat> affectedStats | The stat being changed for each rigidbody inside. |
private float affectValuePerSecond | Stat change per second. Negative drains. |
private HashSet<Rigidbody> alreadyChecked | Rigidbodies already seen, so several colliders on one body count once. |
private bool isOnlyAffectingIfTargetHasStat | Only changes a stat whose base is above 0 (for example phantom heads only add nightmare to those who have some). |
private AreaFilter target | Filter for which kinds of target the area affects. |
private StatDefinition targetStat | The stat to change. |
private static List<Rigidbody> toRemove | Shared scratch list of destroyed rigidbodies to drop. |
private IUnityUpdateMethod updateManagers | The registered UpdateManagers method. |
private static UpdateModule updateModule | Shared update module for all stat affecting areas. |