PlayerVisionComfort
A class in Root.Township, the global namespace.
Client: the movement comfort vignette. It fades in while the player is moved artificially and fades out after, using the player's comfort settings.
- Listed in Global namespace: P
Constructors
| Member | What it is |
|---|---|
PlayerVisionComfort(PlayerController controller, IPlatformDevice platformDevice, IPostProcessController postProcessController) | Creates a PlayerVisionComfort from controller, platformDevice and postProcessController. |
Fields
| Member | What it is |
|---|---|
protected static Logger logger | NLog logger for the class. |
10 private and internal fields
| Member | What it is |
|---|---|
private float confortSpeed | How fast the comfort ramps up while moving. |
private PlayerController controller | The player controller being watched. |
private float currentComfort | Current ramp value, from 0 to 1. |
private bool hasBeenMoved | True if the player was moved since the last update. |
private float maxConfortIntensity | Vignette strength at full comfort, from the strength setting. |
private readonly IPlatformDevice platformDevice | Device the movement FOV source is set on. |
private readonly IPostProcessController postProcessController | Post processing controller that draws the vignette. |
private PlayerVisionComfortSettings settings | The global vision comfort settings. |
private IUnityUpdateMethod update | Handle for the late update registration. |
private bool wasMoved | Whether the player was moved in the previous update. |
Methods
| Member | What it is |
|---|---|
void Dispose() | Stops the update and unsubscribes from settings changes. |
7 private and internal methods
| Member | What it is |
|---|---|
private void OnPostProcessValuesReset() | Applies the comfort strength again after post processing values are reset. |
private void UpdateBasedOnSettings(Settings settings) | Applies the comfort strength and speed from the game settings. |
private void UpdateComfort() | Late update: ramps the comfort up while moved and down otherwise, then sets the vignette level. |
private void UpdateFOV() | Same ramp as UpdateComfort but only sets the device's movement FOV source. Nothing calls it. |
private void UpdateMoved() | Marks that the player was moved this frame. Hooked to the controller's hasBeenMoved. |
private void UpdateSettings(MovementConfortStrength comfortLevel) | Applies a comfort strength (turning the vignette on or off) or a comfort speed setting. |
private void UpdateSettings(MovementConfortSpeed confortSpeed) | Applies a comfort strength (turning the vignette on or off) or a comfort speed setting. |
Used in
Members of other types that take, return or hold a PlayerVisionComfort: