Utilizing Time Trial Data Effectively
Guide
Last updated
Guide
Last updated
This section covers how to effectively utilize the data that Complete Time Trial System provides. There are 2 main ways this can be done in which this guide covers both.
You can either:
Use the built-in Unity Events provided by the LapTimeTrackingObject in the inspector to run your own logic based on time trial events
Access LapTimeTrackingObject data directly through the provided read-only public properties to use in your own logic
Complete Time Trial System (as of version 1.1.0) now provides Unity Events in the inspector of any LapTimeTrackingObject to apply your own logic based on time trial events that occur. These make extending the time trial system much simpler to add your own functionality. The provided events are:
OnTimerStarted() - Called when the time trial timer has started. This happens when the LapTimeTrackingObject has passed the first point.
OnValidLapCompleted() – Called when a valid lap has been completed by the LapTimeTrackingObject. This means that all points in the TrackManager have been passed and no cheating was detected.
OnSectorPassed() - Called when a sector has been passed. This means a distance from one point to another.
OnNewBestLapTime() - Called when a new best lap time has been achieved. Mainly useful in combination with the TimeTrialSaveManager or when using your own method of storing lap times.
As of version 1.1.0, Complete Time Trial System now provides easier access to important time trial data through the LapTimeTrackingObject. This is done through read only public properties that allow you to access time trial values for your own purposes. These are:
BestLapTime – Raw best lap time value of type double
BestLapTimeConverted – Best lap time converted to a clean string representation with time formatting
CurrentLapTime – Raw current lap time value of type double
CurrentLapTimeConverted – Current lap time converted to a clean string representation with time formatting