llando
  • Overview
    • 💡Introduction
    • ✨Feature List
  • Guides
    • 📪Quick Setup
    • 📪Manual Setup
    • 📪Utilizing Time Trial Data Effectively
    • 📪Adding Time Trial UI
    • 📪Adding Time Trial Saves
    • 📪Accessing Time Trial Data
    • 📪Adding New Tracks
  • Components/Prefabs
    • 📪TrackManager
    • 📪LapTimeTrackingObject
    • 📪TrackPoint
    • 📪TimeTrialUIManager
    • 📪TimeTrialSaveManager
    • 📪TTSystem
  • Internal Classes
    • 📪Sector
    • 📪LapTimeTrackingEditor
Powered by GitBook
On this page
  • Where To Find Time Trial Data:
  • What Next?
  1. Guides

Accessing Time Trial Data

Guide

Last updated 26 days ago

Once you have time trial logic setup, there are an infinite number of different ways you may want to make use of it. For example: displaying time trial data in custom UI, saving to a leaderboard backend etc.

To do this, you need to hook into the data that Complete Time Trial System provides to use it for your own use cases.

Where To Find Time Trial Data:

  • To access time trial data, declare a reference to the in your script and assign it accordingly. You can then access time trial data from this reference directly.

    • The majority of time trial data is held in the component. This is because it allows time trial data to be unique to the object, allowing many objects to all keep track of their own time trial data simultaneously.

    • If you want to access data in all using your own script, a good option is to store a list of relevant in that script. This could be a list of your players, AI opponents etc.

    • The various time trial data stored in the that can be accessed is seen below.

in :

public Sector[] sectors { get; set; } // Used to access individual sector data

private double bestLapTime = double.MaxValue; // Raw time
public double BestLapTime => bestLapTime; // Raw time, as read-only public property

public string BestLapTimeConverted { get; private set; } = "-"; // Formatted time

private double currentLapTime = 0; // Raw time
public double CurrentLapTime => currentLapTime // Raw time, as read-only public property

public string CurrentLapTimeConverted { get; private set; } // Formatted time

private bool isLapInProgress = false;

What Next?

sectors - see for details

bestLapTime - Raw time value of the best lap time for that

BestLapTimeConverted - Formatted best lap time for that

currentLapTime - Raw time value of the current lap time for that

CurrentLapTimeConverted - Formatted current lap time for that

isLapInProgress - Check whether that is currently in a lap

📪
LapTimeTrackingObject
LapTimeTrackingObject
LapTimeTrackingObjects
LapTimeTrackingObjects
LapTimeTrackingObject
LapTimeTrackingObject.cs
Sector
LapTimeTrackingObject
LapTimeTrackingObject
LapTimeTrackingObject
LapTimeTrackingObject
LapTimeTrackingObject
How do I add time trial UI to my project?
How do I make time trial data save across game sessions?