Skip to main content

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​

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

Fields​

4 private and internal fields
MemberWhat it is
private VisualEffectType effectTypeWhich effect to drive: frost or exposure.
private IPostProcessController postProcessControllerInjected post-process controller.
private StatDefinition statDefinitionThe stat to follow.
private Stat statToTrackMeant to hold the tracked stat for unhooking, but never assigned.

Methods​

MemberWhat 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
MemberWhat 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.