PlayerStatBasedVisualEffect
A class in Root.Township, ATT.PlayerStates.
Client: drives a post-process effect (frost or exposure) from one of the local player's health stats.
Constructors
| Member | What it is |
|---|
PlayerStatBasedVisualEffect() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
4 private and internal fields
| Member | What it is |
|---|
private VisualEffectType effectType | Which effect to drive: frost or exposure. |
private IPostProcessController postProcessController | Injected post-process controller. |
private StatDefinition statDefinition | The stat to follow. |
private Stat statToTrack | Meant to hold the tracked stat for unhooking, but never assigned. |
Methods
| Member | What it is |
|---|
void InitializeAsLocalPlayer(PlayerController playerController) | Finds the stat on the local player's health and listens for its changes. |
protected void Inject(IPostProcessController newPostProcessController) | VContainer injection of the post-process controller. |
2 private and internal methods
| Member | What it is |
|---|
private void OnDestroy() | Unhooks the stat listener. statToTrack is never set, so in practice it never unhooks. |
private void UpdateVisualEffect(Stat stat) | Sets the frost strength or exposure to the stat's value. |