A class in Root.Township, Alta.Alchemy.
Trigger volume that applies a liquid's effect to health objects while they are inside it and removes it when they leave. Server only; on clients it turns itself off on the first trigger.
Constructors
| Member | What it is |
|---|
EffectArea() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private Dictionary<Collider, EffectHandler> affecting | Colliders inside the area and their effect handlers. |
private LiquidDefinition effect | The LiquidDefinition whose effect data is applied. |
private float strength | Strength to apply on entry (and remove on exit). |
Methods
| Member | What it is |
|---|
protected virtual void EnterObject(EffectHandler handler) | Applies the liquid's effect at strength to the handler that entered. |
protected virtual EffectHandler GetHandler(Collider other) | Finds the EffectHandler of the collider's ImpactDetector health target, or null. |
protected virtual void LeaveObject(EffectHandler handler) | Applies the effect at negative strength to undo it. |
3 private and internal methods
| Member | What it is |
|---|
private void OnDisable() | Undoes the effect on everything still inside and clears the list. |
private void OnTriggerEnter(Collider other) | Server: tracks the collider and applies the effect. Client: disables the component. |
private void OnTriggerExit(Collider other) | Undoes the effect on a tracked collider and stops tracking it. |