ClimbingHandlerAnalytics
A class in Root.Township, Features.Climbing.
Editor-only climbing telemetry: records jump-off speeds and stamina used per climb for the local player. Sending to the API is stubbed out; Ctrl+U writes the records to CSV files in the data folder.
- Listed in ATT, Features and other game namespaces
- Nested types
StaminaTracker
Constructors
| Member | What it is |
|---|---|
ClimbingHandlerAnalytics() | Creates a ClimbingHandlerAnalytics with default values. |
Fields
13 private and internal fields
| Member | What it is |
|---|---|
private IAnalyticsService analyticsService | The injected analytics service. Not used in this build. |
private float climbingEndTimer | Real time at which the grace period after letting go runs out, or 0. |
private IUnityUpdateMethod climbingMovementTrack | Handle of the registered per-frame tracking method while a climb is recorded. |
private const float gracePeriodForContinuingClimbing | 0.5 seconds of not climbing before a climb record is finished. |
private ClimbingHandler handler | The local player's climbing handler being tracked. |
private List<float> jumpVelocityRecords | Recorded jump-off speeds. |
private Vector3 lastPosition | Locomotion position on the last tick. |
private const int minimumRecordsToSendToAPI | 10, the record count meant to trigger a send. |
private const float minimumVelocityToRecordSquared | Squared speed below which a let-go is not recorded as a jump. |
private ClimbingHandlerAnalytics.StaminaTracker staminaTrackerLeftHand | Tracks stamina used by the left hand this climb. |
private ClimbingHandlerAnalytics.StaminaTracker staminaTrackerRightHand | Tracks stamina used by the right hand this climb. |
private List<StaminaUsageRecord> staminaUsageRecords | Recorded climbs with distance and stamina used. |
private float travelledDistance | Distance climbed. Never reset between climbs in this code. |
Methods
| Member | What it is |
|---|---|
void Inject(IAnalyticsService analyticsService) | Receives the analytics service from VContainer. |
10 private and internal methods
| Member | What it is |
|---|---|
private async void CheckForCurrentPlayer(PlayerController currentPlayer) | When the current player changes to a PlayerCharacter with a Climber, sets up tracking on its climbing handler. |
private bool CheckGracePeriodForFinishClimbing() | Returns true until 0.5 seconds after climbing stops, so short let-gos do not end the climb record. |
private void FinishClimbingTrack() | Stops tracking and stores the climb's distance and per-hand stamina used. |
private void HandStartedClimbing() | Starts per-climb tracking of stamina and position when the first hand grabs. |
private void HandStoppedClimbing() | When both hands have let go, records the jump-off speed if it is above the minimum. |
private void PrintLocal(Key key) | On Ctrl+U, writes the jump and stamina records to two CSV files in Application.dataPath. |
private void SendAnalyticsEventIfFull() | Meant to send once there are 10 records; its body is empty in this build. |
private void Setup(ClimbingHandler handler) | Hooks both hands' climbing start and stop events and registers the Ctrl+U dump key. |
private void TickPositionTracking() | Adds the distance moved since last frame to travelledDistance. |
private void TrackClimbingMovement() | Per-frame update during a climb: ticks stamina and distance, or ends the record after the grace period. |