PlayerEffectManager
A class in Root.Township, the global namespace.
Client: shows smoke, burn, light and stat buff or debuff effects on a player's body points from their heat points and stats. It destroys itself on headless servers.
- Listed in Global namespace: P
- Inherits or implements
MonoBehaviour - Nested types
EffectApplication,EffectPointStatus,EffectPosition,LightEffect,OverrideSettings,StatEffectApplication
Constructors
| Member | What it is |
|---|---|
PlayerEffectManager() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
15 private and internal fields
| Member | What it is |
|---|---|
private PooledObjectDefinition burnEffect | Pooled effect shown when a body point is hot enough to burn. |
private float burnMinThreshold | Temperature at which a body point starts burning. |
private PlayerEffectManager.EffectPosition[] effectPositions | The body points that can show effects, each tied to a heat point. |
private Dictionary<HeatPoint, PlayerEffectManager.EffectPointStatus> heatPointStatus | Effect state for each heat point. |
private float[] levels | The smoke and burn temperature thresholds, in that order. |
private PlayerEffectManager.LightEffect lightEffect | The glow light shown while any body point burns. |
private PooledObjectDefinition lightEffectDefinition | Pooled light used for the burning glow. |
private Transform lightEffectParent | Transform the glow light is spawned under. |
private AnimationCurve lightIntensityByBurningPoints | Curve from the number of burning body points to light intensity. |
private PooledObjectDefinition smokeEffect | Pooled effect shown when a body point is hot enough to smoke. |
private float smokeMinThreshold | Temperature at which a body point starts smoking. |
private StatEffectsDefinition statEffectsDefinition | Asset listing the stats that have buff and debuff effects. |
private StatManager statManager | The player's stats, watched for buffs and debuffs. |
private AnimationCurve temperatureToScaleMultiplier | Curve from temperature to burn effect size. |
private PlayerController thisPlayer | The player this manager belongs to. |
Properties
| Member | What it is |
|---|---|
IEnumerable<StatEffectHolder> StatEffects { get; } | The stat effects listed in statEffectsDefinition. |
Methods
7 private and internal methods
| Member | What it is |
|---|---|
private void ActivateStatEffect(StatDefinition definition, bool isBuff, bool isActive) | Turns a stat's buff or debuff effect on or off at every body point that shows stat effects. |
private void RunStatEffectCommand(StatDefinition definition, bool isBuff, Action<PlayerEffectManager.EffectApplication> command) | Runs an action on the buff or debuff effect for a stat at every body point that shows stat effects. |
private void SetLocalPlayer() | Sets up each body point and the stat effect watchers once the player is known to be local or remote. |
private bool SetupLevels() | Inspector helper that keeps levels equal to the smoke and burn thresholds. |
private void Start() | Destroys the component on headless servers, otherwise sets up now or once linked to a network player. |
private void UpdateLightEffects() | Spawns or updates the glow light based on how many body points are burning, and releases it when none are. |
private void UpdateStatEffect(StatDefinition definition, bool isBuff, float size) | Resizes a stat's buff or debuff effect at every body point that shows stat effects. |
Used in
Members of other types that take, return or hold a PlayerEffectManager: