// Use this for initialization void Start() { UIManager.GetInst().mPanelInGame.lapCollector = this; playerLapInfos = new PlayerLapInfo(); for (int i = 0; i < checkPointList.Length; ++i) { checkPointList[i].index = i; } }
public void HandlePlayerPassedFinish(Player player) { PlayerLapInfo oldInfo = lapInfos[player]; float previousTime = oldInfo.CurrentLapTime; lapInfos[player] = new PlayerLapInfo(oldInfo.laps + 1, Mathf.Min(oldInfo.bestTime, previousTime), previousTime, Time.time, oldInfo.totalTime + previousTime); }