Skip to main content

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.

Constructors​

MemberWhat it is
PlayerVisionComfort(PlayerController controller, IPlatformDevice platformDevice, IPostProcessController postProcessController)Creates a PlayerVisionComfort from controller, platformDevice and postProcessController.

Fields​

MemberWhat it is
protected static Logger loggerNLog logger for the class.
10 private and internal fields
MemberWhat it is
private float confortSpeedHow fast the comfort ramps up while moving.
private PlayerController controllerThe player controller being watched.
private float currentComfortCurrent ramp value, from 0 to 1.
private bool hasBeenMovedTrue if the player was moved since the last update.
private float maxConfortIntensityVignette strength at full comfort, from the strength setting.
private readonly IPlatformDevice platformDeviceDevice the movement FOV source is set on.
private readonly IPostProcessController postProcessControllerPost processing controller that draws the vignette.
private PlayerVisionComfortSettings settingsThe global vision comfort settings.
private IUnityUpdateMethod updateHandle for the late update registration.
private bool wasMovedWhether the player was moved in the previous update.

Methods​

MemberWhat it is
void Dispose()Stops the update and unsubscribes from settings changes.
7 private and internal methods
MemberWhat 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: