To add in-game UI of relevant time trial data into your project, simply drag the TimeTrialUIManager prefab into your scene.
This will automatically display time trial UI for you, but the data will not be saved. This means that relaunching the game will reset the UI such as personal best lap time.
Modifying TimeTrialUIManager To Make Use Of Your Own UI:
To use your own custom (and much better looking) UI, simply modify the TimeTrialUIManager component to use your own UI elements by changing its references. By default, the TimeTrialUIManager references UI objects from the TimeTrialUI prefab.
If you need more flexibility, you can also create a custom script to handle your time trial UI instead. This is slightly more complicated as the LapTimeTrackingObject automatically references the TimeTrialUIManager component so that it works right away.
This is a small change and simply requires changing any references to the TimeTrialUIManager in the LapTimeTrackingObject to make use of your own script instead.
// Replace declaration with your own script referenceprivateTimeTrialUIManagertimeTrialUI;// Replace initialization with own logictimeTrialUI=FindObjectOfType<TimeTrialUIManager>();// Change all other references in LapTimeTrackingObject.cs
Time trial data can also be accessed by referencing the LapTimeTrackingObject component on the script where you want to access that data.