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
  • Running Your Own Logic Based On Time Trial Events:
  • Running Your Own Logic Based On Time Trial Events:
  • What Next?
  1. Guides

Utilizing Time Trial Data Effectively

Guide

Last updated 26 days ago

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

Running Your Own Logic Based On Time Trial Events:

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.

Running Your Own Logic Based On Time Trial Events:

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

What Next?

📪
How do I add time trial UI to my project?
How do I make time trial data save across game sessions?
How do I add time trials to multiple tracks?