ClimbingHandler
A class in Root.Township, Features.Climbing.
Runs climbing for one player's smooth locomotion: tracks both hands' grips and stamina, moves and turns the body as the hands move, and holds the body up against gravity.
- Listed in ATT, Features and other game namespaces
Constructors
| Member | What it is |
|---|---|
ClimbingHandler(SmoothLocomotion smoothLocomotion, PlayerUnlock unlock) | Creates a ClimbingHandler from smoothLocomotion and unlock. |
Fields
10 private and internal fields
| Member | What it is |
|---|---|
private readonly LocomotionController coreLocomotion | The player's locomotion controller. |
private readonly Transform head | The player's head transform. |
private RelativePoint headCacheLateUpdate | Head position from the last late update, used to pin the head while climbing. |
private readonly ClimbingPressureCalculator leftHandPressureCalculator | Pressure maths for the left hand. |
private float minMoveDistanceCache | Character controller min move distance saved while climbing (set to 0). |
private const string PlayerWeightStatName | Name of the stat added to the base weight (playerweight). |
private readonly ClimbingPressureCalculator rightHandPressureCalculator | Pressure maths for the right hand. |
private float stateChangeTime | When climbing last started or stopped, used for Friction. |
private readonly PlayerUnlockManager unlockManager | The player's unlock manager, which can override the climb layer mask. |
private readonly Stat weightStat | The player's weight stat, added to the base weight. |
Properties
| Member | What it is |
|---|---|
float BodyHeight { get; private set; } | The current body height. Moves toward the climbing height while climbing and back to normal after. |
float Friction { get; } | Ground friction from the settings' fade curve, low just after letting go and rising over time. |
bool IsClimbing { get; } | True while either hand is holding a climbable surface. |
LayerMask LayerMask { get; } | Layers that can be climbed. A current unlock that overrides climbing replaces the settings' mask. |
ClimbingHand LeftHand { get; } | Climbing state for the left hand. |
IHandStaminaManager LeftStamina { get; } | Stamina for the left hand. A fake one that never runs out when the character has no health. |
ClimbingHand RightHand { get; } | Climbing state for the right hand. |
IHandStaminaManager RightStamina { get; } | Stamina for the right hand. A fake one that never runs out when the character has no health. |
ClimbingSettings Settings { get; set; } | The climbing settings, ClimbingSettings.Instance by default. |
SmoothLocomotion SmoothLocomotion { get; } | The locomotion this handler moves. |
Methods
7 private and internal methods
Used in
Members of other types that take, return or hold a ClimbingHandler: